From aecead316241c5e52a6cf5cdcf23a28225107f84 Mon Sep 17 00:00:00 2001 From: tech234a <46801700+tech234a@users.noreply.github.com> Date: Wed, 23 Sep 2020 23:46:23 -0400 Subject: [PATCH] Use a lower thread count on Heroku for memory limits --- worker.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/worker.py b/worker.py index 9911b7a..88747fe 100644 --- a/worker.py +++ b/worker.py @@ -253,8 +253,11 @@ del runthread sleep(5) -#now create the other 49 threads -for i in range(49): +THREADCNT = 49 +if HEROKU: + THREADCNT = 19 +#now create the rest of the threads +for i in range(THREADCNT): runthread = Thread(target=threadrunner, args=(jobs,)) runthread.start() threads.append(runthread)