def do_backoff(self):
if self.backoff == 0:
self.backoff = 5*60
else:
self.backoff *= 2
if self.backoff > 1800:
self.backoff = 1800
self.log(10, "backoff: retry in %d minutes" % (int(self.backoff)/60))
#
# If this is the first backoff of a repeat timer remember the original
# begin/end times, so that we can use *these* when setting up the
# repeat.
# A repeat timer (self.repeat != 0) is one set for a given time on a
# day.
# A timer that repeats every <n> mins has autosleeprepeat="repeated" and
# is a different beast, whcih doesn't need, and mustn't have, this.
#
if self.repeated and not hasattr(self, "real_begin"):
self.real_begin = self.begin
self.real_end = self.end
评论列表
文章目录