Skip to content

Commit 015ce8a

Browse files
authored
Set start time of extractors. (#458)
1 parent 184f8fe commit 015ce8a

File tree

1 file changed

+3
-0
lines changed
  • cognite/extractorutils/unstable/core

1 file changed

+3
-0
lines changed

cognite/extractorutils/unstable/core/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def my_task_function(self, task_context: TaskContext) -> None:
4747
import logging
4848
import time
4949
from concurrent.futures import ThreadPoolExecutor
50+
from datetime import datetime, timezone
5051
from functools import partial
5152
from logging.handlers import TimedRotatingFileHandler
5253
from multiprocessing import Queue
@@ -146,6 +147,7 @@ def __init__(self, config: FullConfig[ConfigType]) -> None:
146147
self._tasks: list[Task] = []
147148
self._task_updates: list[TaskUpdate] = []
148149
self._errors: dict[str, Error] = {}
150+
self._start_time: datetime
149151

150152
self.__init_tasks__()
151153

@@ -435,6 +437,7 @@ def run(self) -> None:
435437
with extractor:
436438
extractor.run()
437439
"""
440+
self._start_time = datetime.now(tz=timezone.utc)
438441
has_scheduled = False
439442

440443
startup: list[StartupTask] = []

0 commit comments

Comments
 (0)