Skip to content

Commit

Permalink
nit: styling
Browse files Browse the repository at this point in the history
  • Loading branch information
northdpole committed Sep 29, 2024
1 parent 2a66eec commit a0bb178
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion application/cmd/cre_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion application/tests/cre_main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def test_parse_file(self) -> None:
"objects",
"here",
{
1: 2,
"1": 2,
},
],
scollection=self.collection,
Expand Down
11 changes: 2 additions & 9 deletions application/worker.py
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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()

0 comments on commit a0bb178

Please sign in to comment.