Commit 1fbee0c2 authored by Ziirish's avatar Ziirish

make sure celery doesn't prevent the main server to talk to the monitor while...

make sure celery doesn't prevent the main server to talk to the monitor while performing huge computes
parent d1257189
Pipeline #1599 passed with stages
in 12 minutes and 42 seconds
......@@ -7,6 +7,7 @@
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
"""
import os
import re
import json
import ssl
......@@ -204,6 +205,11 @@ class Burp(Burp2):
self.concurrency = conf.safe_get('concurrency', 'integer', 'Parallel', BUI_DEFAULTS)
self.init_wait = conf.safe_get('init_wait', 'integer', 'Parallel', BUI_DEFAULTS)
if os.getenv('BUI_MODE', '') == 'celery':
# we cap the concurrency level in order not to prevent our main server
# to talk to the monitor
self.concurrency = max(1, self.concurrency // 2)
self.logger.info('burp conf cli: {}'.format(self.burpconfcli))
self.logger.info('burp conf srv: {}'.format(self.burpconfsrv))
self.logger.info('command timeout: {}'.format(self.timeout))
......
......@@ -155,14 +155,17 @@ EOF
echo "Starting crond..."
supervisorctl start cron >/dev/null
[ -n "$CELERY" ] && {
echo "Starting bui-celery..."
supervisorctl start bui-celery >/dev/null
}
[ -n "$ASYNC" ] && {
echo "Starting bui-monitor..."
supervisorctl start bui-monitor >/dev/null
echo "Wait a bit for the monitor to be up and running..."
sleep 10
}
[ -n "$CELERY" ] && {
echo "Starting bui-celery..."
supervisorctl start bui-celery >/dev/null
}
echo "Starting gunicorn..."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment