Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
brian-dashboard-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
brian
brian-dashboard-manager
Commits
67f5a8e8
Commit
67f5a8e8
authored
3 years ago
by
Bjarke Madsen
Browse files
Options
Downloads
Patches
Plain Diff
Add sanity check to resolve problem seen on servers
parent
e2473814
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
brian_dashboard_manager/routes/update.py
+7
-0
7 additions, 0 deletions
brian_dashboard_manager/routes/update.py
with
7 additions
and
0 deletions
brian_dashboard_manager/routes/update.py
+
7
−
0
View file @
67f5a8e8
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment