Skip to content

Commit

Permalink
Fix batch regenerate applicability for repo
Browse files Browse the repository at this point in the history
Pulp calculates the applicability for repo in the batch size
of 10 but the profiles of the 10th consumer in the batch will
always be missed. This commit fixed it.

closes: #6724
https://pulp.plan.io/issues/6724
  • Loading branch information
hao-yu committed May 26, 2020
1 parent 1d10da5 commit 2d032c6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/pulp/server/managers/consumer/applicability.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,8 @@ def queue_regenerate_applicability_for_repos(repo_criteria):
continue
seen_hashes.add(all_profiles_hash)
profiles = consumer_profile_map[consumer_id]['profiles']
if len(profiles_to_process) < batch_size:
profiles_to_process.append((repo_id, all_profiles_hash, profiles))
else:
profiles_to_process.append((repo_id, all_profiles_hash, profiles))
if len(profiles_to_process) >= batch_size:
batch_regenerate_applicability_task.apply_async(
(profiles_to_process,), **{'group_id': task_group_id})
profiles_to_process = []
Expand Down

0 comments on commit 2d032c6

Please sign in to comment.