From 9347f648f85f5ef4f03604bd25c7a2f18f516f17 Mon Sep 17 00:00:00 2001 From: Spyros Date: Sat, 28 Sep 2024 12:03:27 +0100 Subject: [PATCH] nit: styling --- application/cmd/cre_main.py | 2 +- application/tests/cre_main_test.py | 2 +- application/worker.py | 11 ++--------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/application/cmd/cre_main.py b/application/cmd/cre_main.py index f9287953d..968d1c4f5 100644 --- a/application/cmd/cre_main.py +++ b/application/cmd/cre_main.py @@ -643,7 +643,7 @@ def run(args: argparse.Namespace) -> None: # pragma: no cover if args.start_worker: from application.worker import start_worker - start_worker(args.cache_file) + start_worker() if args.preload_map_analysis_target_url: gap_analysis.preload(target_url=args.preload_map_analysis_target_url) diff --git a/application/tests/cre_main_test.py b/application/tests/cre_main_test.py index 1912f04e6..46270fb51 100644 --- a/application/tests/cre_main_test.py +++ b/application/tests/cre_main_test.py @@ -367,7 +367,7 @@ def test_parse_file(self) -> None: "objects", "here", { - 1: 2, + "1": 2, }, ], scollection=self.collection, diff --git a/application/worker.py b/application/worker.py index 104e05ebe..76b2057ba 100644 --- a/application/worker.py +++ b/application/worker.py @@ -1,9 +1,5 @@ -import os -import redis from rq import Worker, Queue, Connection -from application.database import db import logging -from application.cmd.cre_main import db_connect from application.utils import redis logging.basicConfig() @@ -12,11 +8,8 @@ listen = ["high", "default", "low"] - -def start_worker(cache: str): - conn = redis.connect() +def start_worker(): logger.info(f"Worker Starting") - database = db_connect(path=cache) - with Connection(conn): + with Connection(redis.connect()): worker = Worker(map(Queue, listen)) worker.work()