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.
archive/original-v2.1
Mike Lang 6 years ago
parent b42d4aa0e8
commit 8848b24208

@ -35,8 +35,14 @@ class Job(object):
@property @property
def uploader(self): def uploader(self):
"""A processed uploader check that ignores dead bots""" """A processed uploader check that ignores dead bots (except for publish)"""
return self.row.uploader if self.row.uploader in self.wubloader.heartbeat.alive else "" # 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 @property
def excluded(self): def excluded(self):

@ -65,7 +65,7 @@ class Wubloader(object):
for job in self.find_jobs(): for job in self.find_jobs():
# If it's already claimed, ignore it. # 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: if job.uploader and job.uploader != self.name:
continue continue

Loading…
Cancel
Save