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

Commit

Permalink
Only update last_publish if success and not canceled
Browse files Browse the repository at this point in the history
Only update the last_publish field is the publish was a success and not
canceled.

fixes #2263
https://pulp.plan.io/issues/2263
  • Loading branch information
David Davis committed Jan 30, 2017
1 parent f9fe1b1 commit 485645f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/pulp/server/controllers/repository.py
Expand Up @@ -1272,9 +1272,10 @@ def _do_publish(repo_obj, dist_id, dist_inst, transfer_repo, conduit, call_confi
dist = model.Distributor.objects.get_or_404(
repo_id=repo_obj.repo_id, distributor_id=dist_id)

# Use raw pymongo not to fire the signal hander
model.Distributor.objects(repo_id=repo_obj.repo_id, distributor_id=dist_id).\
update(set__last_publish=publish_end_timestamp)
if not publish_report.canceled_flag:
# Use raw pymongo not to fire the signal hander
model.Distributor.objects(repo_id=repo_obj.repo_id, distributor_id=dist_id).\
update(set__last_publish=publish_end_timestamp)

# Add a publish entry
summary = publish_report.summary
Expand Down

0 comments on commit 485645f

Please sign in to comment.