Fix: The server was also using the worker settings to communicate with redis.

This led to it using the default host and port as the backend .env files do not contain worker settings.
This commit is contained in:
Amritanshu Agrawal 2021-03-19 06:54:55 +05:30
parent e99b8f3070
commit 592f26af20
3 changed files with 8 additions and 3 deletions

View File

@ -2,4 +2,4 @@ from arq.connections import RedisSettings
from barker.core.config import settings as sett
settings = RedisSettings(host=sett.WORKER_REDIS_HOST, port=sett.WORKER_REDIS_PORT)
settings = RedisSettings(host=sett.REDIS_HOST, port=sett.REDIS_PORT)

View File

@ -0,0 +1,5 @@
from arq.connections import RedisSettings
from barker.core.config import settings as sett
settings = RedisSettings(host=sett.WORKER_REDIS_HOST, port=sett.WORKER_REDIS_PORT)

View File

@ -4,7 +4,7 @@ from aiohttp import ClientSession
from barker.core.config import settings as sett
from barker.tasks.printing import sent_to_printer
from .core.arq import settings
from .core.arq_worker import settings
sys.path.extend(["./"])
@ -13,7 +13,7 @@ sys.path.extend(["./"])
async def startup(ctx):
ctx["session"] = ClientSession()
print(f"Worker listening for: {sett.WORKER_QUEUE_NAME}")
print(f"Worker printing on: {sett.WORKER_PRINTER_ADDRESS}")
# print(f"Worker printing on: {sett.WORKER_PRINTER_ADDRESS}")
async def shutdown(ctx):