20 lines
424 B
Python
20 lines
424 B
Python
from .config import tiktok_config
|
|
|
|
import celery
|
|
import redis
|
|
|
|
c = tiktok_config()
|
|
|
|
app = celery.Celery(
|
|
__name__,
|
|
broker=c.celery_broker,
|
|
result_backend=c.celery_result_backend,
|
|
)
|
|
|
|
app.autodiscover_tasks(c.celery_imports)
|
|
|
|
redis = dict(
|
|
broker=redis.Redis(host='redis', db=int(c.celery_broker.split('/')[-1])),
|
|
result_backend=redis.Redis(host='redis', db=int(c.celery_result_backend.split('/')[-1])),
|
|
)
|