mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-10 00:56:19 +01:00
Template supervisor conf.
Update docs to reflect simple installation. Ensure allianceauth celery workers can find config file for development (doesn't work as celeryapp.py).
This commit is contained in:
16
allianceauth/project_template/celeryapp.py
Normal file
16
allianceauth/project_template/celeryapp.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import os
|
||||
from celery import Celery
|
||||
|
||||
# set the default Django settings module for the 'celery' program.
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', '{{ project_name }}.settings.local')
|
||||
|
||||
from django.conf import settings # noqa
|
||||
|
||||
app = Celery('{{ project_name }}')
|
||||
|
||||
# Using a string here means the worker don't have to serialize
|
||||
# the configuration object to child processes.
|
||||
app.config_from_object('django.conf:settings')
|
||||
|
||||
# Load task modules from all registered Django app configs.
|
||||
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
|
||||
36
allianceauth/project_template/supervisor.conf
Normal file
36
allianceauth/project_template/supervisor.conf
Normal file
@@ -0,0 +1,36 @@
|
||||
[program:beat]
|
||||
command={{ pythonpath}}/celery -A {{ project_name }} beat
|
||||
directory={{ project_directory }}
|
||||
user=allianceserver
|
||||
stdout_logfile={{ project_directory }}/log/beat.log
|
||||
stderr_logfile={{ project_directory }}/log/beat.log
|
||||
autostart=true
|
||||
autorestart=true
|
||||
startsecs=10
|
||||
priority=998
|
||||
|
||||
[program:worker]
|
||||
command={{ pythonpath}}/celery -A {{ project_name }} worker
|
||||
directory={{ project_directory }}
|
||||
user=allianceserver
|
||||
numprocs=1
|
||||
stdout_logfile={{ project_directory }}/log/worker.log
|
||||
stderr_logfile={{ project_directory }}/log/worker.log
|
||||
autostart=true
|
||||
autorestart=true
|
||||
startsecs=10
|
||||
stopwaitsecs = 600
|
||||
killasgroup=true
|
||||
priority=998
|
||||
|
||||
[program:gunicorn]
|
||||
user = allianceserver
|
||||
directory={{ project_directory }}
|
||||
command={{ pythonpath}}/gunicorn {{ project_name}}.wsgi --workers=3 --timeout 120
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stopsignal=INT
|
||||
|
||||
[group:{{ project_name }}]
|
||||
programs=beat,worker,gunicorn
|
||||
priority=999
|
||||
Reference in New Issue
Block a user