Commit 6d252907 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼 Committed by Rafael Monnerat

[webrunner]: use latest key in equeue.db to get last backup date

in some webrunner, there are 2 keys in equeue.db:

```
>>> print(db.keys())
['/srv/slapgrid/slappart18/bin//runner-importer', '/srv/slapgrid/slappart18/bin/runner-importer']
```

We suppose that the 2nd key was used after the first key so we take the
timestamp of the last key.

/reviewed-on nexedi/slapos!578
parent 010b8afd
...@@ -46,7 +46,7 @@ md5sum = d21472f0e58f928fb827f2cbf22c4d4a ...@@ -46,7 +46,7 @@ md5sum = d21472f0e58f928fb827f2cbf22c4d4a
[resilient-web-takeover-cgi-script-download] [resilient-web-takeover-cgi-script-download]
filename = resilient-web-takeover-cgi-script.py.in filename = resilient-web-takeover-cgi-script.py.in
md5sum = 9d258d41eeef66f44f361adaa15cbd71 md5sum = 60d4912fdf5e8dafaba9d9f333aa9e36
[template-wrapper] [template-wrapper]
filename = templates/wrapper.in filename = templates/wrapper.in
......
...@@ -42,7 +42,7 @@ def getLatestBackupDate(): ...@@ -42,7 +42,7 @@ def getLatestBackupDate():
if not db.keys(): if not db.keys():
result = False result = False
else: else:
last_backup = db[db.keys()[0]] last_backup = db[db.keys()[-1]]
for callback in db.keys(): for callback in db.keys():
timestamp = float(db[callback]) timestamp = float(db[callback])
if timestamp < last_backup: if timestamp < last_backup:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment