-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathapp.py
More file actions
26 lines (20 loc) · 737 Bytes
/
app.py
File metadata and controls
26 lines (20 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from __future__ import absolute_import, unicode_literals
import os
from celery import Celery
from celery import shared_task
from _main_.celery.config import CeleryConfig
from _main_.utils.massenergize_logger import log
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "_main_.settings")
app = Celery('massenergize_celeryapp')
celery_config = CeleryConfig().get_config()
app.config_from_object(celery_config)
app.autodiscover_tasks()
app.conf.beat_schedule = {
# 'send_weekly_event_nudge': {
# 'task': 'task_queue.tasks.send_weekly_events_report',
# 'schedule': crontab(hour=9, minute=0, day_of_week=1)
# },
}
@shared_task(bind=True)
def debug_task(self):
log.info('Request: {0!r}'.format(self.request))