mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Reduce frequency of heartbeat
This commit is contained in:
parent
8fd666e662
commit
edbbfff1af
@ -40,5 +40,5 @@ class InvenTreeConfig(AppConfig):
|
||||
InvenTree.tasks.schedule_task(
|
||||
'InvenTree.tasks.heartbeat',
|
||||
schedule_type=Schedule.MINUTES,
|
||||
minutes=5
|
||||
minutes=15
|
||||
)
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user