Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion charon/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
INVALIDATION_BATCH_DEFAULT = 3000
INVALIDATION_BATCH_WILDCARD = 15

INVALIDATION_STATUS_COMPLETED = "Completed"
INVALIDATION_STATUS_INPROGRESS = "InProgress"

DEFAULT_BUCKET_TO_DOMAIN = {
"prod-ga": "maven.repository.redhat.com",
"prod-maven-ga": "maven.repository.redhat.com",
Expand Down Expand Up @@ -91,7 +94,7 @@ def invalidate_paths(
current_invalidation = {}
for batch_paths in real_paths:
while (current_invalidation and
'InProgress' == current_invalidation.get('Status', '')):
INVALIDATION_STATUS_INPROGRESS == current_invalidation.get('Status', '')):
time.sleep(5)
try:
result = self.check_invalidation(distr_id, current_invalidation.get('Id'))
Expand Down
8 changes: 7 additions & 1 deletion charon/pkgs/pkg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,15 @@ def invalidate_cf_paths(
distr_id, final_paths, real_batch_size
)
if result:
output = {}
for invalidation in result:
status = invalidation.get('Status')
if status not in output:
output[status] = []
output[status].append(invalidation["Id"])
logger.info(
"The CF invalidating request for metadata/indexing is sent, "
"request status as below:\n %s", result
"request result as below:\n %s", output
)
else:
logger.error(
Expand Down