diff --git a/docker-compose.yml b/docker-compose.yml index 97c63c2..72eb694 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -40,7 +40,7 @@ services: restart: always build: context: . - command: celery -A werkout worker -l info + command: celery -A werkout_api worker -l info volumes: - .:/code environment: diff --git a/misc/CHECKS b/misc/dokku/CHECKS similarity index 100% rename from misc/CHECKS rename to misc/dokku/CHECKS diff --git a/misc/DOKKU_SCALE b/misc/dokku/DOKKU_SCALE similarity index 100% rename from misc/DOKKU_SCALE rename to misc/dokku/DOKKU_SCALE diff --git a/misc/Procfile b/misc/dokku/Procfile similarity index 67% rename from misc/Procfile rename to misc/dokku/Procfile index 6a35008..4346cf7 100644 --- a/misc/Procfile +++ b/misc/dokku/Procfile @@ -1,3 +1,3 @@ web: daphne werkout_api.asgi:application --port 5000 --bind 0.0.0.0 -v2 beat: /usr/local/bin/celery -A werkout beat -linfo -worker: python3 manage.py runworker channel_layer -v2 \ No newline at end of file +worker: /usr/local/bin/celery-A werkout_api worker -l info \ No newline at end of file diff --git a/misc/app.json b/misc/dokku/app.json similarity index 100% rename from misc/app.json rename to misc/dokku/app.json diff --git a/misc/uwsgi.ini b/misc/dokku/uwsgi.ini similarity index 100% rename from misc/uwsgi.ini rename to misc/dokku/uwsgi.ini diff --git a/requirements.txt b/requirements.txt index bf14d0f..f491ded 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ amqp==5.1.1 asgiref==3.7.2 +async-timeout==4.0.2 billiard==4.1.0 celery==5.3.1 click==8.1.3 @@ -24,6 +25,7 @@ psycopg2==2.9.6 python-dateutil==2.8.2 pytz==2023.3 PyYAML==6.0 +redis==4.6.0 six==1.16.0 sqlparse==0.4.4 tablib==3.5.0 diff --git a/werkout_api/celery.py b/werkout_api/celery.py index be85e4a..2b61d1d 100644 --- a/werkout_api/celery.py +++ b/werkout_api/celery.py @@ -1,8 +1,8 @@ import os from celery import Celery -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'werkout.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'werkout_api.settings') -app = Celery('werkout') +app = Celery('werkout_api') app.config_from_object('django.conf:settings', namespace='CELERY') app.autodiscover_tasks() \ No newline at end of file diff --git a/werkout_api/settings.py b/werkout_api/settings.py index b9028ac..03d1b81 100644 --- a/werkout_api/settings.py +++ b/werkout_api/settings.py @@ -158,15 +158,6 @@ if os.environ.get("DATABASE_URL"): CELERY_BROKER_URL = os.environ.get("REDIS_URL", "") + "/1" CELERY_RESULT_BACKEND = os.environ.get("REDIS_URL", "") + "/1" - CHANNEL_LAYERS = { - 'default': { - 'BACKEND': 'channels_redis.core.RedisChannelLayer', - "CONFIG": { - "hosts": [os.environ.get('REDIS_URL', 'redis://localhost:6379')], - } - } - } - INTERNAL_IPS = [ "127.0.0.1", ] @@ -185,15 +176,6 @@ else: CELERY_BROKER_URL = "redis://redis:6379" CELERY_RESULT_BACKEND = "redis://redis:6379" - CHANNEL_LAYERS = { - 'default': { - 'BACKEND': 'channels_redis.core.RedisChannelLayer', - 'CONFIG': { - 'hosts': [('redis', 6379)], - } - } - } - INTERNAL_IPS = [ "127.0.0.1", ]