Reduce frequency of heartbeat

This commit is contained in:
Oliver Walters 2021-03-23 19:58:29 +11:00
parent 8fd666e662
commit edbbfff1af
2 changed files with 4 additions and 4 deletions

View File

@ -40,5 +40,5 @@ class InvenTreeConfig(AppConfig):
InvenTree.tasks.schedule_task(
'InvenTree.tasks.heartbeat',
schedule_type=Schedule.MINUTES,
minutes=5
minutes=15
)

View File

@ -29,12 +29,12 @@ def is_q_cluster_running(**kwargs):
"""
Sometimes Stat.get_all() returns [].
In this case we have the 'heartbeat' task running every five minutes.
Check to see if we have a result within the last ten minutes
In this case we have the 'heartbeat' task running every 15 minutes.
Check to see if we have a result within the last 20 minutes
"""
now = datetime.now()
past = now - timedelta(minutes=10)
past = now - timedelta(minutes=20)
results = Success.objects.filter(
func='InvenTree.tasks.heartbeat',