def _nextBackup(self, now: datetime, last_backup: Optional[datetime]) -> Optional[datetime]:
    timeofDay = self.getTimeOfDay()
    if (self.config.get(Setting.DAYS_BETWEEN_BACKUPS) <= 0):
        next = None
    elif self.dest.needsConfiguration():
        next = None
    elif (not last_backup):
        next = (now - timedelta(minutes=1))
    elif (not timeofDay):
        next = (last_backup + timedelta(days=self.config.get(Setting.DAYS_BETWEEN_BACKUPS)))
    else:
        newest_local: datetime = self.time.toLocal(last_backup)
        time_that_day_local = datetime(newest_local.year, newest_local.month, newest_local.day, timeofDay[0], timeofDay[1], tzinfo=self.time.local_tz)
        if (newest_local < time_that_day_local):
            next = self.time.toUtc(time_that_day_local)
        else:
            next = self.time.toUtc((time_that_day_local + timedelta(days=self.config.get(Setting.DAYS_BETWEEN_BACKUPS))))
    if ((next is not None) and (next < now) and (now < self.info.backupCooldownTime()) and (not self.ignore_startup_delay)):
        self.waiting_for_startup = True
        return self.info.backupCooldownTime()
    else:
        self.waiting_for_startup = False
        return next
def _nextBackup(self, now: datetime, last_backup: Optional[datetime]) -> Optional[datetime]:
    timeofDay = self.getTimeOfDay()
    if (self.config.get(Setting.DAYS_BETWEEN_BACKUPS) <= 0):
        next = None
    elif self.dest.needsConfiguration():
        next = None
    elif (not last_backup):
        next = (now - timedelta(minutes=1))
    elif (not timeofDay):
        next = (last_backup + timedelta(days=self.config.get(Setting.DAYS_BETWEEN_BACKUPS)))
    else:
        newest_local: datetime = self.time.toLocal(last_backup)
        time_that_day_local = datetime(newest_local.year, newest_local.month, newest_local.day, timeofDay[0], timeofDay[1], tzinfo=self.time.local_tz)
        if (newest_local < time_that_day_local):
            next = self.time.toUtc(time_that_day_local)
        else:
            next = self.time.toUtc((time_that_day_local + timedelta(days=self.config.get(Setting.DAYS_BETWEEN_BACKUPS))))
    if ((next is not None) and (next < now) and (now < self.info.backupCooldownTime()) and (not self.ignore_startup_delay)):
        self.waiting_for_startup = True
        return self.info.backupCooldownTime()
    else:
        self.waiting_for_startup = False
        return next