This commit is contained in:
retoor 2025-09-15 02:12:52 +02:00
parent 0518cdce0b
commit fb754cad92

View File

@ -26,10 +26,10 @@ class ChannelMessageService(BaseService):
self._executor_pools = {} self._executor_pools = {}
global jinja2_env global jinja2_env
jinja2_env = self.app.jinja2_env jinja2_env = self.app.jinja2_env
self._max_workers = 1 self._max_workers = 3
def get_or_create_executor(self, uid): def get_or_create_executor(self, uid):
if not uid in self._executor_pools: if not uid in self._executor_pools:
self._executor_pools[uid] = ProcessPoolExecutor(max_workers=10) self._executor_pools[uid] = ProcessPoolExecutor(max_workers=self._max_workers)
print("Executors available", len(self._executor_pools)) print("Executors available", len(self._executor_pools))
return self._executor_pools[uid] return self._executor_pools[uid]