Вызов настройки в задачу

This commit is contained in:
zakhy 2024-08-08 13:25:57 +07:00
parent 1947ade79e
commit 26d046572c

View File

@ -18,8 +18,6 @@ from apps.main.services.base_service import DashboardBaseService
from sabron.util import logging
from sabron.util.sabronmodule import get_settings
control_conveyor = get_settings("control_conveyor")
@shared_task
def create_worktime_data() -> int:
@ -30,7 +28,8 @@ def create_worktime_data() -> int:
"""
# TODO переписать под ситуации, создать модуль настроек для упр. конвейера
try:
now_date = timezone.now()
control_conveyor = get_settings("control_conveyor")
now_date = DashboardBaseService.get_current_time()
start_day = now_date - relativedelta(hours=2)
latest_records = (
ScalesControl.objects.filter(name=control_conveyor, time__gte=start_day)