fix: правка урла кролика
parent
fc9577c538
commit
68db31a033
|
@ -2,6 +2,7 @@ import asyncio
|
|||
|
||||
from celery import Celery
|
||||
|
||||
from ..fastfood.config import settings
|
||||
from .updater import main
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
|
@ -9,7 +10,7 @@ loop = asyncio.get_event_loop()
|
|||
|
||||
celery_app = Celery(
|
||||
'tasks',
|
||||
broker='amqp://guest:guest@localhost',
|
||||
broker=settings.REBBITMQ_URL,
|
||||
backend='rpc://',
|
||||
include=['bg_tasks.bg_task'],
|
||||
)
|
||||
|
|
|
@ -66,6 +66,17 @@ class Settings(BaseSettings):
|
|||
|
||||
return f'redis://{self.REDIS_HOST}:{self.REDIS_PORT}/{self.REDIS_DB}'
|
||||
|
||||
@property
|
||||
def REBBITMQ_URL(self):
|
||||
"""
|
||||
Возвращает строку подключения к REBBITMQ
|
||||
"""
|
||||
file_path = '/usr/src/RUN_IN_DOCKER'
|
||||
if os.path.exists(file_path):
|
||||
return 'amqp://guest:guest@localhost'
|
||||
|
||||
# return f"redis://{self.REDIS_HOST}:{self.REDIS_PORT}/{self.REDIS_DB}"
|
||||
|
||||
model_config = SettingsConfigDict(env_file='.env')
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue