From 446600fd3ed34ff7ac2f5bc284262324ed58f667 Mon Sep 17 00:00:00 2001 From: Kastan Day Date: Fri, 15 Sep 2023 15:00:03 -0700 Subject: [PATCH] use treads instead of processes? Maybe this prevents autokill? --- ai_ta_backend/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ai_ta_backend/main.py b/ai_ta_backend/main.py index e32b8b7d..982feae6 100644 --- a/ai_ta_backend/main.py +++ b/ai_ta_backend/main.py @@ -1,6 +1,7 @@ import gc import os import time +from concurrent.futures import wait from typing import List from dotenv import load_dotenv @@ -16,7 +17,8 @@ app = Flask(__name__) CORS(app) executor = Executor(app) -# app.config['EXECUTOR_MAX_WORKERS'] = 5 nothing == picks defaults for me +app.config['EXECUTOR_TYPE'] = 'thread' # thread is default, or 'process' +app.config['EXECUTOR_MAX_WORKERS'] = 5 # load API keys from globally-availabe .env file load_dotenv()