forked from github/plane
1a9faa025a
* fix: file name change * feat: added xml json and csv export * chore: added openpyxl package * fix: added initiated_by field * fix: added initiated by details * dev: refactoring * fix: rendering assignee name and labels in sheet * fix: handeled exception in label * feat: implemented link expiration scheduler(8 days) * fix: removed the expired field --------- Co-authored-by: NarayanBavisetti <narayan311@gmail.com> Co-authored-by: pablohashescobar <nikhilschacko@gmail.com>
32 lines
1.0 KiB
Python
32 lines
1.0 KiB
Python
import os
|
|
from celery import Celery
|
|
from plane.settings.redis import redis_instance
|
|
from celery.schedules import crontab
|
|
|
|
# Set the default Django settings module for the 'celery' program.
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "plane.settings.production")
|
|
|
|
ri = redis_instance()
|
|
|
|
app = Celery("plane")
|
|
|
|
# Using a string here means the worker will not have to
|
|
# pickle the object when using Windows.
|
|
app.config_from_object("django.conf:settings", namespace="CELERY")
|
|
|
|
app.conf.beat_schedule = {
|
|
# Executes every day at 12 AM
|
|
"check-every-day-to-archive-and-close": {
|
|
"task": "plane.bgtasks.issue_automation_task.archive_and_close_old_issues",
|
|
"schedule": crontab(hour=0, minute=0),
|
|
},
|
|
"check-every-day-to-delete_exporter_history": {
|
|
"task": "plane.bgtasks.exporter_expired_task.delete_old_s3_link",
|
|
"schedule": crontab(hour=0, minute=0),
|
|
},
|
|
}
|
|
|
|
# Load task modules from all registered Django app configs.
|
|
app.autodiscover_tasks()
|
|
|
|
app.conf.beat_scheduler = 'django_celery_beat.schedulers.DatabaseScheduler' |