From 77f1fbc2cc609af034f2e4fbbef80f9f2570992f Mon Sep 17 00:00:00 2001 From: "R. Miles McCain" Date: Mon, 4 May 2020 14:20:34 -0400 Subject: [PATCH] Fix faulty parallelization --- TEMPLATE.env | 4 +++- shynet/shynet/settings.py | 2 +- shynet/ssl.webserver.sh | 2 +- shynet/webserver.sh | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/TEMPLATE.env b/TEMPLATE.env index 63f325d..df9f3ee 100644 --- a/TEMPLATE.env +++ b/TEMPLATE.env @@ -57,8 +57,10 @@ SHYNET_HOST=shynet.example.com # What you'd like to call your Shynet instance. SHYNET_WHITELABEL=My Shynet Instance -# Redis and queue settings; not necessary for single-instance deployments. +# Redis, queue, and parellization settings; not necessary for single-instance deployments. # Don't uncomment these unless you know what you are doing! +# NUM_WORKERS=1 +# Make sure you set a REDIS_CACHE_LOCATION if you have more than one frontend worker/instance. # REDIS_CACHE_LOCATION=redis://redis.default.svc.cluster.local/0 # If CELERY_BROKER_URL is set, make sure CELERY_TASK_ALWAYS_EAGER is False and # that you have a separate queue consumer running somewhere via `celeryworker.sh`. diff --git a/shynet/shynet/settings.py b/shynet/shynet/settings.py index 20e431d..e832bc3 100644 --- a/shynet/shynet/settings.py +++ b/shynet/shynet/settings.py @@ -14,7 +14,7 @@ import os from django.contrib.messages import constants as messages # Increment on new releases -VERSION = "v0.3.1" +VERSION = "v0.3.2" # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) diff --git a/shynet/ssl.webserver.sh b/shynet/ssl.webserver.sh index 40047f0..647776d 100755 --- a/shynet/ssl.webserver.sh +++ b/shynet/ssl.webserver.sh @@ -4,7 +4,7 @@ echo Launching Shynet web server... exec gunicorn shynet.wsgi:application \ --bind 0.0.0.0:8080 \ - --workers 3 \ + --workers ${NUM_WORKERS:-1} \ --timeout 100 \ --certfile=cert.pem \ --keyfile=privkey.pem \ No newline at end of file diff --git a/shynet/webserver.sh b/shynet/webserver.sh index 5e092a7..7c4da40 100755 --- a/shynet/webserver.sh +++ b/shynet/webserver.sh @@ -3,5 +3,5 @@ echo Launching Shynet web server... exec gunicorn shynet.wsgi:application \ --bind 0.0.0.0:8080 \ - --workers 3 \ + --workers ${NUM_WORKERS:-1} \ --timeout 100