Initial commit
This commit is contained in:
21
backend/app/worker/queue.py
Normal file
21
backend/app/worker/queue.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""Queue connection helpers used by API and worker processes."""
|
||||
|
||||
from redis import Redis
|
||||
from rq import Queue
|
||||
|
||||
from app.core.config import get_settings
|
||||
|
||||
|
||||
settings = get_settings()
|
||||
|
||||
|
||||
def get_redis() -> Redis:
|
||||
"""Creates a Redis connection from configured URL."""
|
||||
|
||||
return Redis.from_url(settings.redis_url)
|
||||
|
||||
|
||||
def get_processing_queue() -> Queue:
|
||||
"""Returns the named queue for document processing jobs."""
|
||||
|
||||
return Queue("dcm", connection=get_redis())
|
||||
Reference in New Issue
Block a user