From 8848b2420806cc414b8cb74b7aad2286b5e3e626 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Wed, 12 Sep 2018 06:24:00 -0700 Subject: [PATCH] Further protection to prevent claimant changing for publish jobs Since drafter must also be publisher, we don't allow anything to ever cause publish jobs' claimant to change. --- wubloader/job.py | 10 ++++++++-- wubloader/wubloader.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/wubloader/job.py b/wubloader/job.py index af86559..97ac4cb 100644 --- a/wubloader/job.py +++ b/wubloader/job.py @@ -35,8 +35,14 @@ class Job(object): @property def uploader(self): - """A processed uploader check that ignores dead bots""" - return self.row.uploader if self.row.uploader in self.wubloader.heartbeat.alive else "" + """A processed uploader check that ignores dead bots (except for publish)""" + # Note we can't safely ignore a claimed publish because the drafter needs to be the same + # as the publisher. + return ( + self.row.uploader + if self.job_type == 'publish' or self.row.uploader in self.wubloader.heartbeat.alive + else "" + ) @property def excluded(self): diff --git a/wubloader/wubloader.py b/wubloader/wubloader.py index e195b5e..d0f8501 100644 --- a/wubloader/wubloader.py +++ b/wubloader/wubloader.py @@ -65,7 +65,7 @@ class Wubloader(object): for job in self.find_jobs(): # If it's already claimed, ignore it. - # Note this check considers a claim by a dead bot to be invalid. + # Note this check considers a claim by a dead bot to be invalid (except for publishes). if job.uploader and job.uploader != self.name: continue