auto: black run
This commit is contained in:
@@ -46,11 +46,7 @@ def _process_main(results_queue: queue.Queue, task: AnalyzeTask):
|
||||
res["status"] = "success"
|
||||
except Exception as err:
|
||||
logging.exception(f"Error {err} with {task.url}")
|
||||
res = {
|
||||
"status": "error",
|
||||
"message": str(err),
|
||||
"task_id": task.task_id
|
||||
}
|
||||
res = {"status": "error", "message": str(err), "task_id": task.task_id}
|
||||
results_queue.put(res)
|
||||
|
||||
|
||||
@@ -58,10 +54,7 @@ def rabbit_callback(ch, method, properties, body):
|
||||
task = AnalyzeTask.from_data(json.loads(body))
|
||||
logging.info(f"New task url: {task.url}, level: {task.level}")
|
||||
res_queue = multiprocessing.Queue()
|
||||
method_process = multiprocessing.Process(
|
||||
target=_process_main,
|
||||
args=(res_queue, task)
|
||||
)
|
||||
method_process = multiprocessing.Process(target=_process_main, args=(res_queue, task))
|
||||
method_process.start()
|
||||
for delay in delay_generator():
|
||||
ch.connection.sleep(delay)
|
||||
|
||||
Reference in New Issue
Block a user