Admin onboarding + BrickGrid + workflow author fix

This commit is contained in:
Vladless
2026-04-17 10:45:30 +00:00
parent 11b5a8f4bd
commit 4cb84ceacc
13 changed files with 389 additions and 11 deletions
+8 -8
View File
@@ -22,12 +22,9 @@ def _atexit_shutdown_pools() -> None:
shutdown_thread_pool()
class _IgnoreSIGINTProcess(multiprocessing.Process):
"""Процесс, игнорирующий SIGINT в воркере, чтобы Ctrl+C не обрывал queue.get() с трейсбеком."""
def run(self) -> None:
signal.signal(signal.SIGINT, signal.SIG_IGN)
super().run()
def _worker_ignore_sigint() -> None:
"""Initializer воркера: игнорирует SIGINT, чтобы Ctrl+C не обрывал queue.get() с трейсбеком."""
signal.signal(signal.SIGINT, signal.SIG_IGN)
def get_thread_pool() -> ThreadPoolExecutor:
@@ -62,8 +59,11 @@ def get_process_pool() -> ProcessPoolExecutor:
size = max(1, min(int(PROCESS_POOL_SIZE), multiprocessing.cpu_count() or 4))
ctx = multiprocessing.get_context("spawn")
ctx.Process = _IgnoreSIGINTProcess
_process_pool = ProcessPoolExecutor(max_workers=size, mp_context=ctx)
_process_pool = ProcessPoolExecutor(
max_workers=size,
mp_context=ctx,
initializer=_worker_ignore_sigint,
)
atexit.register(_atexit_shutdown_pools)
logger.debug("[Executor] Пул процессов: {} воркеров", size)
return _process_pool