Page MenuHomePhabricator

Clean up the workflow for some post-push logging code

Authored by epriestley on Nov 6 2018, 9:24 PM.



Ref T13216. When a repository is clustered, we run this cleanup code (to tell the repository to update, and log some timing information) on both nodes. Currently, we do slightly too much work, which is unnecessary and can be a bit confusing to human readers.

The double update message doesn't hurt anything, but there's no reason to write it twice.

Likewise, the second timing information update query doesn't do anything: there's no PushEvent object with the right identifier, so it just updates nothing. We don't need to run it, and it's confusing that we do.

Instead, only do these writes if we're actually the final node with the repository on it.

Test Plan

Added some logging, saw double writes/updates before the change and no doubles afterwards, with no other behavioral changes.

Diff Detail

rP Phabricator
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Nov 6 2018, 9:24 PM
epriestley requested review of this revision.Nov 6 2018, 9:25 PM
amckinley accepted this revision.Nov 7 2018, 6:11 PM
This revision is now accepted and ready to land.Nov 7 2018, 6:11 PM
This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Nov 8 2018, 1:46 AM