From 51bf447eb7b8ce4c48857eb2da2458472836a322 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Mon, 11 Mar 2024 17:42:22 -0700 Subject: [PATCH] Allow REFLEX_COMPILE_PROCESSES=0 to trigger multiprocessing with auto workers --- reflex/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reflex/app.py b/reflex/app.py index d7c0786f8..ae0dd54a7 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -860,8 +860,9 @@ class App(Base): # Use a forking process pool, if possible. Much faster, especially for large sites. # Fallback to ThreadPoolExecutor as something that will always work. executor = None - if platform.system() in ("Linux", "Darwin") and os.environ.get( - "REFLEX_COMPILE_PROCESSES" + if ( + platform.system() in ("Linux", "Darwin") + and os.environ.get("REFLEX_COMPILE_PROCESSES") is not None ): executor = concurrent.futures.ProcessPoolExecutor( max_workers=int(os.environ.get("REFLEX_COMPILE_PROCESSES", 0)) or None,