13 lines
261 B
Python
13 lines
261 B
Python
from celery import Celery
|
|
from dotenv import load_dotenv
|
|
import os
|
|
|
|
load_dotenv()
|
|
|
|
RABBITMQ_URL = os.getenv("RABBITMQ_URL")
|
|
appCelery = Celery('tasks', backend = 'redis://localhost:6379/0' , broker=RABBITMQ_URL)
|
|
|
|
@appCelery.task
|
|
def add(x, y):
|
|
return x + y
|