fix: rundramatiq

This commit is contained in:
helsonxiao 2022-05-08 17:13:22 +08:00
parent 75c4d8d286
commit e009777c6f
2 changed files with 9 additions and 8 deletions

View File

@ -39,7 +39,7 @@ stopwaitsecs = 5
killasgroup=true
[program:dramatiq]
command=python3 manage.py rundramatiq --no-reload --processes %(ENV_MAX_WORKER_NUM)s --threads 4
command=python3 manage.py rundramatiq --processes %(ENV_MAX_WORKER_NUM)s --threads 4
directory=/app/
user=nobody
stdout_logfile=/data/log/dramatiq.log

View File

@ -1,22 +1,23 @@
# coding=utf-8
import os
from utils.shortcuts import get_env
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'HOST': '127.0.0.1',
'PORT': 5435,
'NAME': "onlinejudge",
'USER': "onlinejudge",
'PASSWORD': 'onlinejudge'
'HOST': get_env('POSTGRES_HOST', '127.0.0.1'),
'PORT': get_env('POSTGRES_PORT', '5435'),
'NAME': get_env('POSTGRES_DB', 'onlinejudge'),
'USER': get_env('POSTGRES_USER', 'onlinejudge'),
'PASSWORD': get_env('POSTGRES_PASSWORD', 'onlinejudge')
}
}
REDIS_CONF = {
"host": "127.0.0.1",
"port": "6380"
'host': get_env('REDIS_HOST', '127.0.0.1'),
'port': get_env('REDIS_PORT', '6380')
}