fix previous optimization to retry_failed
This commit is contained in:
parent
4ff384f5c7
commit
92cf880db2
10
tisbackup.py
10
tisbackup.py
@ -246,13 +246,13 @@ class tis_backup:
|
|||||||
# before mindate, backup is too old
|
# before mindate, backup is too old
|
||||||
mindate = datetime2isodate((datetime.datetime.now() - datetime.timedelta(hours=maxage_hours)))
|
mindate = datetime2isodate((datetime.datetime.now() - datetime.timedelta(hours=maxage_hours)))
|
||||||
failed_backups = self.dbstat.query("""\
|
failed_backups = self.dbstat.query("""\
|
||||||
select backup_name as bname, max(backup_start)
|
select distinct backup_name as bname
|
||||||
from stats
|
from stats
|
||||||
where not status="OK" and backup_start>=?
|
where status="OK" and backup_start>=?""",(mindate,))
|
||||||
group by backup_name """,(mindate,))
|
|
||||||
|
defined_backups = map(lambda f:f.backup_name, [ x for x in self.backup_list if not isinstance(x, backup_null) ])
|
||||||
|
failed_backups_names = set(defined_backups) - set([b['bname'] for b in failed_backups if b['bname'] in defined_backups])
|
||||||
|
|
||||||
defined_backups = map(lambda f:f.backup_name,self.backup_list)
|
|
||||||
failed_backups_names = [b['bname'] for b in failed_backups if b['bname'] in defined_backups]
|
|
||||||
|
|
||||||
if failed_backups_names:
|
if failed_backups_names:
|
||||||
self.logger.info('Processing backup for %s',','.join(failed_backups_names))
|
self.logger.info('Processing backup for %s',','.join(failed_backups_names))
|
||||||
|
Loading…
Reference in New Issue
Block a user