check start is not None before checking whether hour is before start

pull/129/head
Christopher Usher 5 years ago
parent f8835cd253
commit 8579fcaeea

@ -424,12 +424,13 @@ class BackfillerWorker(object):
for hour in hours: for hour in hours:
# since backfilling can take a long time, recheck whether this # since backfilling can take a long time, recheck whether this
# hour is after the start # hour is after the start
if not isinstance(self.start, datetime.datetime): if self.start is not None:
start_hour = datetime.datetime.utcnow() - datetime.timedelta(hours=self.start) if not isinstance(self.start, datetime.datetime):
else: start_hour = datetime.datetime.utcnow() - datetime.timedelta(hours=self.start)
start_hour = self.start else:
if datetime.datetime.strptime(hour, HOUR_FMT) < start_hour: start_hour = self.start
break if datetime.datetime.strptime(hour, HOUR_FMT) < start_hour:
break
self.logger.info('Backfilling {}/{}'.format(quality, hour)) self.logger.info('Backfilling {}/{}'.format(quality, hour))

Loading…
Cancel
Save