|
@@ -10,6 +10,7 @@ from lib import run_process
|
|
|
from classes.Ticket import Ticket
|
|
|
from typing import List
|
|
|
from concurrent.futures import ThreadPoolExecutor
|
|
|
+from utils.SystemdKiller import SystemdKiller
|
|
|
|
|
|
botname = "open_access_request_pending"
|
|
|
operating_status = 320
|
|
@@ -56,7 +57,9 @@ def start_handler():
|
|
|
tickets: List[Ticket] = get_fake_data()
|
|
|
|
|
|
with ThreadPoolExecutor() as executor:
|
|
|
- while True:
|
|
|
+ killer = SystemdKiller()
|
|
|
+
|
|
|
+ while not killer.exit_event.is_set():
|
|
|
# Параллельная обработка всех тикетов
|
|
|
processed = list(executor.map(run_process(interval_attempts_unlimited, processing), tickets))
|
|
|
|
|
@@ -65,7 +68,7 @@ def start_handler():
|
|
|
|
|
|
logging.debug(tickets)
|
|
|
logging.debug("Sleep")
|
|
|
- sleep(INTERVAL_TIME)
|
|
|
+ killer.exit_event.wait(timeout=INTERVAL_TIME)
|
|
|
|
|
|
|
|
|
# START CUSTOM FUNCTIONS
|