Skip to content
This repository was archived by the owner on Dec 7, 2022. It is now read-only.

Commit dfd5677

Browse files
authored
Merge pull request #419 from lubosmj/total-values-count
Get number of total tags before finishing the task
2 parents 0c2551e + 414d62d commit dfd5677

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

pulp_docker/app/tasks/sync_stages.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from django.db import IntegrityError
1111
from pulpcore.plugin.models import Artifact, ProgressReport, Remote
1212
from pulpcore.plugin.stages import DeclarativeArtifact, DeclarativeContent, Stage
13+
from pulpcore.constants import TASK_STATES
1314

1415
from pulp_docker.app.models import (Manifest, MEDIA_TYPE, Blob, Tag,
1516
BlobManifest, ManifestListManifest)
@@ -78,7 +79,10 @@ async def run(self):
7879
to_download.append(downloader.run(extra_data={'headers': V2_ACCEPT_HEADERS}))
7980

8081
pb_parsed_tags = ProgressReport(
81-
message='Processing Tags', code='processing.tag', state='running'
82+
message='Processing Tags',
83+
code='processing.tag',
84+
state=TASK_STATES.RUNNING,
85+
total=len(tag_list)
8286
)
8387

8488
for download_tag in asyncio.as_completed(to_download):
@@ -115,7 +119,6 @@ async def run(self):
115119
pb_parsed_tags.increment()
116120

117121
pb_parsed_tags.state = 'completed'
118-
pb_parsed_tags.total = pb_parsed_tags.done
119122
pb_parsed_tags.save()
120123

121124
for manifest_future in asyncio.as_completed(future_manifests):

0 commit comments

Comments
 (0)