diff --git a/estela-api/api/views/project.py b/estela-api/api/views/project.py index 5b42b812..32d8dcb0 100644 --- a/estela-api/api/views/project.py +++ b/estela-api/api/views/project.py @@ -21,7 +21,7 @@ ProjectUsageSerializer, UsageRecordSerializer, ) -from api.utils import update_env_vars +from api.utils import update_env_vars, update_stats_from_redis from core.models import ( Activity, DataStatus, @@ -242,6 +242,9 @@ def jobs(self, request, *args, **kwargs): spider_set = Spider.objects.filter(project=kwargs["pid"]) sid_set = spider_set.values_list("pk", flat=True) jobs_set = SpiderJob.objects.filter(spider__in=sid_set) + for job in jobs_set: + if job.status == SpiderJob.RUNNING_STATUS: + update_stats_from_redis(job) paginator_result = Paginator(jobs_set, page_size) page_result = paginator_result.page(page) results = SpiderJobSerializer(page_result, many=True) diff --git a/estela-web/src/pages/JobDetailPage/index.tsx b/estela-web/src/pages/JobDetailPage/index.tsx index 6fb9fc5f..61f9b37b 100644 --- a/estela-web/src/pages/JobDetailPage/index.tsx +++ b/estela-web/src/pages/JobDetailPage/index.tsx @@ -660,6 +660,7 @@ export class JobDetailPage extends Component, J spiderName, totalResponseBytes, items, + itemsCount, status, storageSize, } = this.state; @@ -932,6 +933,12 @@ export class JobDetailPage extends Component, J )} + + + Item Count + + {itemsCount} +