Skip to content
Snippets Groups Projects
Commit 67f5a8e8 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Add sanity check to resolve problem seen on servers

parent e2473814
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,13 @@ def should_provision():
timestamp = datetime.datetime.fromtimestamp(
state.get('timestamp', 1))
now = datetime.datetime.now()
if provisioning and (now - timestamp).total_seconds() > 86400:
# if we stay in provisioning state
# for over a day, we probably restarted
# and the state file is out of sync.
provisioning = False
can_provision = not provisioning
return can_provision, timestamp
except FileNotFoundError:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment