mirror of
https://github.com/FuzzyGrim/Yamtrack.git
synced 2026-03-03 02:27:01 +00:00
add celery beat schedule
This commit is contained in:
@@ -5,3 +5,4 @@ __pycache__
|
||||
venv
|
||||
src/staticfiles
|
||||
src/db/db.sqlite3
|
||||
celerybeat-schedule
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@ __pycache__
|
||||
venv
|
||||
src/staticfiles
|
||||
src/db/db.sqlite3
|
||||
celerybeat-schedule
|
||||
|
||||
@@ -99,7 +99,7 @@ Then run the following commands.
|
||||
python -m pip install -U -r requirements-dev.txt
|
||||
cd src
|
||||
python manage.py migrate
|
||||
python manage.py runserver & celery --app config worker -l DEBUG
|
||||
python manage.py runserver & celery --app config worker --beat -S django --loglevel DEBUG
|
||||
```
|
||||
|
||||
Go to: http://localhost:8000
|
||||
|
||||
@@ -271,3 +271,10 @@ CELERY_CACHE_BACKEND = "default"
|
||||
CELERY_TASK_SERIALIZER = "pickle"
|
||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std-setting-accept_content
|
||||
CELERY_ACCEPT_CONTENT = ["application/json", "application/x-python-serialize"]
|
||||
|
||||
CELERY_BEAT_SCHEDULE = {
|
||||
"reload_calendar": {
|
||||
"task": "Reload calendar",
|
||||
"schedule": 60 * 60 * 6, # every 6 hours
|
||||
},
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
|
||||
[program:celery]
|
||||
command=celery --app config worker --loglevel INFO --without-mingle --without-gossip
|
||||
command=celery --app config worker --beat -S django --loglevel INFO --without-mingle --without-gossip
|
||||
user=abc
|
||||
stopasgroup=true
|
||||
stopwaitsecs=60
|
||||
@@ -20,4 +20,4 @@ priority=5
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
stderr_logfile_maxbytes=0
|
||||
|
||||
Reference in New Issue
Block a user