mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
fix for timezone warning on heartbeat
This commit is contained in:
parent
05142d977a
commit
4d0ce643a1
@ -4,9 +4,10 @@ Provides system status functionality checks.
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
from django.utils import timezone
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from datetime import datetime, timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from django_q.models import Success
|
from django_q.models import Success
|
||||||
from django_q.monitor import Stat
|
from django_q.monitor import Stat
|
||||||
@ -34,7 +35,7 @@ def is_worker_running(**kwargs):
|
|||||||
Check to see if we have a result within the last 20 minutes
|
Check to see if we have a result within the last 20 minutes
|
||||||
"""
|
"""
|
||||||
|
|
||||||
now = datetime.now()
|
now = timezone.now()
|
||||||
past = now - timedelta(minutes=20)
|
past = now - timedelta(minutes=20)
|
||||||
|
|
||||||
results = Success.objects.filter(
|
results = Success.objects.filter(
|
||||||
|
Loading…
Reference in New Issue
Block a user