Skip to content
Snippets Groups Projects
Commit 5742046b authored by Hartung, Michael's avatar Hartung, Michael
Browse files

celery settings

parent 9e510b38
No related branches found
No related tags found
No related merge requests found
...@@ -45,23 +45,27 @@ services: ...@@ -45,23 +45,27 @@ services:
hostname: redis hostname: redis
networks: networks:
- redis_net - redis_net
celery: celery:
restart: always restart: always
build: ./backend build: .
command: celery -A core worker -l info command: celery -A core worker -l info
volumes: volumes:
- ./backend/:/usr/src/app/ - ./:/usr/src/app/
depends_on: depends_on:
- redis - redis
- db
networks:
- redis_net
celery-beat: celery-beat:
build: ./backend build: .
command: celery -A core beat -l info command: celery -A core beat -l info
volumes: volumes:
- ./backend/:/usr/src/app/ - ./:/usr/src/app/
depends_on: depends_on:
- redis - redis
- db
networks:
- redis_net
networks: networks:
db_net: db_net:
......
...@@ -3,6 +3,12 @@ ...@@ -3,6 +3,12 @@
python3 manage.py migrate --run-syncdb python3 manage.py migrate --run-syncdb
python3 manage.py createfixtures python3 manage.py createfixtures
python3 manage.py cleanuptasks python3 manage.py cleanuptasks
# sh import-data.sh
file="docker-entrypoint.lock"
# exit if entrypoint.lock exists to prevent new import of data every time docker is restarted
if ! test -f "$file"; then
sh import-data.sh
touch $file
fi
/usr/bin/supervisord -c "/etc/supervisor/conf.d/supervisord.conf" /usr/bin/supervisord -c "/etc/supervisor/conf.d/supervisord.conf"
...@@ -179,6 +179,6 @@ CELERY_RESULT_BACKEND = "redis://redis:6379" ...@@ -179,6 +179,6 @@ CELERY_RESULT_BACKEND = "redis://redis:6379"
CELERY_BEAT_SCHEDULE = { CELERY_BEAT_SCHEDULE = {
"update_db": { "update_db": {
"task": "control.celery_tasks.task_update_db_from_nedrex", "task": "control.celery_tasks.task_update_db_from_nedrex",
"schedule": crontab(hour=12, minute=15, day_of_week='sun'), "schedule": crontab(minute="*/3"),
} }
} }
...@@ -29,4 +29,4 @@ six==1.15.0 ...@@ -29,4 +29,4 @@ six==1.15.0
sqlparse==0.3.1 sqlparse==0.3.1
urllib3==1.25.10 urllib3==1.25.10
sqlalchemy==1.3.23 sqlalchemy==1.3.23
celery==5.2.6 celery==5.1.2
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment