Skip to content

Commit

Permalink
Merge branch 'master' into web-user-prop-dicts-in
Browse files Browse the repository at this point in the history
  • Loading branch information
soline-b authored Mar 27, 2024
2 parents 14f16b7 + eabc734 commit 0bf07eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clockwork_web/core/users_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ def render_template_with_user_settings(template_name_or_list, **context):


def _jobs_are_old(cluster_name):
"""Return True if last slurm update in given cluster is older than 2 days."""
jobs_are_old = False

mongodb_filter = {"slurm.cluster_name": cluster_name}
Expand All @@ -620,8 +621,8 @@ def _jobs_are_old(cluster_name):
elapsed_time = timedelta(
seconds=current_timestamp - most_recent_job_edition
)
# Let's say the latest jobs edition must not be older than 30 days ago.
max_delay = timedelta(days=30)
# Let's say the latest jobs edition must not be older than max_delay.
max_delay = timedelta(days=2)
jobs_are_old = elapsed_time > max_delay

return jobs_are_old

0 comments on commit 0bf07eb

Please sign in to comment.