Skip to content

Commit

Permalink
MWB-493: update start_time value
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverBerserk committed Dec 20, 2024
1 parent b33e5ca commit b4a70a9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import multiprocessing
from concurrent.futures import CancelledError, TimeoutError
from datetime import datetime
from multiprocessing.managers import BaseManager
from typing import List

from dateutil.tz import tzlocal
from pebble import ProcessPool, ProcessFuture

from mapping_workbench.backend.task_manager.adapters.task import Task, TaskStatus, TaskMetadata
Expand All @@ -22,7 +24,6 @@ def on_task_done_callback(future):
try:
task_result = future.result()
task.update_task_status(task_result.task_status)
task.update_started_at(task_result.started_at)
task.update_finished_at(task_result.finished_at)
task.update_exception_message(task_result.exception_message)
if task.has_response:
Expand Down Expand Up @@ -123,6 +124,8 @@ def update_task_statuses(self):
future = task.get_future()
if future:
if future.running():
if task.get_task_status() == TaskStatus.QUEUED:
task.update_started_at(datetime.now(tzlocal()))
task.update_task_status(TaskStatus.RUNNING)
task.update_progress(task.task_response.get_progress())

Expand Down

0 comments on commit b4a70a9

Please sign in to comment.