fix
This commit is contained in:
parent
357ab5576f
commit
5c1418ddd8
@ -1,6 +1,6 @@
|
|||||||
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
import datetime
|
import datetime
|
||||||
import os
|
import os
|
||||||
from threading import Thread
|
|
||||||
import zoneinfo
|
import zoneinfo
|
||||||
import requests
|
import requests
|
||||||
import time
|
import time
|
||||||
@ -13,6 +13,9 @@ else:
|
|||||||
QUEUES_URL = 'http://queues:1239'
|
QUEUES_URL = 'http://queues:1239'
|
||||||
|
|
||||||
|
|
||||||
|
executor = ThreadPoolExecutor(max_workers=1)
|
||||||
|
|
||||||
|
|
||||||
class QueuesException(Exception):
|
class QueuesException(Exception):
|
||||||
...
|
...
|
||||||
|
|
||||||
@ -36,9 +39,7 @@ class TasksHandlerMixin:
|
|||||||
print(f'metric failed: {e}')
|
print(f'metric failed: {e}')
|
||||||
|
|
||||||
def send_metric(self, start, success, end):
|
def send_metric(self, start, success, end):
|
||||||
# Thread(target=self._send_metric, args=(start, success, end)).start()
|
executor.submit(self._send_metric, start, success, end)
|
||||||
# self._send_metric(start, success, end)
|
|
||||||
...
|
|
||||||
|
|
||||||
def poll(self):
|
def poll(self):
|
||||||
while True:
|
while True:
|
||||||
|
Loading…
Reference in New Issue
Block a user