23 lines
450 B
Python
23 lines
450 B
Python
from celery import Celery
|
|
import os
|
|
|
|
# Redis URL 설정
|
|
redis_url = os.getenv("REDIS_URL", "redis://redis:6379/0")
|
|
|
|
# Celery 앱 생성
|
|
celery_app = Celery(
|
|
"worker",
|
|
broker=redis_url,
|
|
backend=redis_url,
|
|
include=['app.tasks'] # 태스크 모듈 포함
|
|
)
|
|
|
|
# Celery 설정
|
|
celery_app.conf.update(
|
|
task_serializer='json',
|
|
accept_content=['json'],
|
|
result_serializer='json',
|
|
timezone='Asia/Seoul',
|
|
enable_utc=True,
|
|
)
|