2021-03-08 16:49:10 +00:00
|
|
|
""" background tasks """
|
2020-03-31 23:31:33 +00:00
|
|
|
import os
|
2020-04-22 13:53:22 +00:00
|
|
|
from celery import Celery
|
2020-03-31 23:31:33 +00:00
|
|
|
|
2021-09-07 20:51:59 +00:00
|
|
|
from celerywyrm import settings
|
2020-03-31 23:31:33 +00:00
|
|
|
|
|
|
|
# set the default Django settings module for the 'celery' program.
|
2021-03-08 16:49:10 +00:00
|
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "celerywyrm.settings")
|
2020-03-31 23:31:33 +00:00
|
|
|
app = Celery(
|
2021-09-07 20:51:59 +00:00
|
|
|
"tasks", broker=settings.CELERY_BROKER_URL, backend=settings.CELERY_RESULT_BACKEND
|
2020-03-31 23:31:33 +00:00
|
|
|
)
|
2021-11-12 03:10:22 +00:00
|
|
|
|
|
|
|
# priorities
|
|
|
|
LOW = "low_priority"
|
|
|
|
MEDIUM = "medium_priority"
|
|
|
|
HIGH = "high_priority"
|
2022-12-16 22:20:50 +00:00
|
|
|
# import items get their own queue because they're such a pain in the ass
|
|
|
|
IMPORTS = "imports"
|
2023-02-20 20:58:41 +00:00
|
|
|
# I keep making more queues?? this one broadcasting out
|
|
|
|
BROADCAST = "broadcast"
|