diff --git a/bin/boot_server_in_docker b/bin/boot_server_in_docker index cbce26fa..3c20bfd1 100755 --- a/bin/boot_server_in_docker +++ b/bin/boot_server_in_docker @@ -48,7 +48,7 @@ if [[ "${SPIFFWORKFLOW_BACKEND_RUN_DATA_SETUP:-}" != "false" ]]; then fi export IS_GUNICORN="true" -export PROCESS_WAITING_MESSAGES="true" +export RUN_BACKGROUND_SCHEDULER="true" # THIS MUST BE THE LAST COMMAND! -exec poetry run gunicorn ${additional_args} --bind "0.0.0.0:$port" --workers="$workers" --limit-request-line 8192 --timeout 90 --capture-output --access-logfile '-' --log-level debug wsgi:app +exec poetry run gunicorn ${additional_args} --bind "0.0.0.0:$port" --preload --workers="$workers" --limit-request-line 8192 --timeout 90 --capture-output --access-logfile '-' --log-level debug wsgi:app diff --git a/bin/run_server_locally b/bin/run_server_locally index af51c815..cacf42c0 100755 --- a/bin/run_server_locally +++ b/bin/run_server_locally @@ -28,8 +28,8 @@ export APPLICATION_ROOT="/" if [[ -n "${SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA:-}" ]]; then ./bin/boot_server_in_docker else - if [[ -z "${PROCESS_WAITING_MESSAGES:-}" ]]; then - export PROCESS_WAITING_MESSAGES="true" + if [[ -z "${RUN_BACKGROUND_SCHEDULER:-}" ]]; then + export RUN_BACKGROUND_SCHEDULER="true" fi export FLASK_DEBUG=1 diff --git a/docker-compose.yml b/docker-compose.yml index c7075b2b..12a0936f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,7 +62,7 @@ services: - SPIFFWORKFLOW_BACKEND_DATABASE_URI=mysql+mysqlconnector://root:${SPIFFWORKFLOW_BACKEND_MYSQL_ROOT_DATABASE:-my-secret-pw}@localhost:7003/${SPIFFWORKFLOW_BACKEND_DATABASE_NAME:-spiffworkflow_backend_development} - BPMN_SPEC_ABSOLUTE_DIR=/app/process_models - SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA=${SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA:-false} - - PROCESS_WAITING_MESSAGES=true + - RUN_BACKGROUND_SCHEDULER=true ports: - "7000:7000" network_mode: host diff --git a/src/spiffworkflow_backend/__init__.py b/src/spiffworkflow_backend/__init__.py index 9a090330..4701b264 100644 --- a/src/spiffworkflow_backend/__init__.py +++ b/src/spiffworkflow_backend/__init__.py @@ -111,7 +111,7 @@ def create_app() -> flask.app.Flask: app.json = MyJSONEncoder(app) - if app.config["PROCESS_WAITING_MESSAGES"]: + if app.config["RUN_BACKGROUND_SCHEDULER"]: start_scheduler(app) configure_sentry(app) diff --git a/src/spiffworkflow_backend/routes/process_api_blueprint.py b/src/spiffworkflow_backend/routes/process_api_blueprint.py index b499b788..3fcd35b0 100644 --- a/src/spiffworkflow_backend/routes/process_api_blueprint.py +++ b/src/spiffworkflow_backend/routes/process_api_blueprint.py @@ -426,7 +426,7 @@ def process_instance_run( processor.save() ProcessInstanceService.update_task_assignments(processor) - if not current_app.config["PROCESS_WAITING_MESSAGES"]: + if not current_app.config["RUN_BACKGROUND_SCHEDULER"]: MessageService.process_message_instances() process_instance_api = ProcessInstanceService.processor_to_process_instance_api(