prometheus: use total_seconds() method

This commit is contained in:
Christophe Siraut 2020-11-23 14:38:24 +01:00
parent c45149e01e
commit 66725414c7
1 changed files with 1 additions and 1 deletions

View File

@ -145,7 +145,7 @@ def postgresql(ctn):
return -1
sorted_backup_files = sorted(backup_files, key=os.path.getmtime)
created = os.stat(sorted_backup_files[-1]).st_ctime
return((datetime.datetime.now() - datetime.datetime.fromtimestamp(created)).seconds)
return((datetime.datetime.now() - datetime.datetime.fromtimestamp(created)).total_seconds())
recovery = glob.glob("/var/lib/postgresql/*/*/recovery.conf")
if len(recovery) == 0: