fix pool size

This commit is contained in:
jxxghp
2025-06-07 22:00:09 +08:00
parent c002d4619a
commit 23929f5eaa
13 changed files with 30 additions and 21 deletions

View File

@@ -2,14 +2,15 @@ from concurrent.futures import ThreadPoolExecutor
from typing import Optional
from app.utils.singleton import Singleton
from core.config import settings
class ThreadHelper(metaclass=Singleton):
"""
线程池管理
"""
def __init__(self, max_workers: Optional[int] = 50):
self.pool = ThreadPoolExecutor(max_workers=max_workers)
def __init__(self):
self.pool = ThreadPoolExecutor(max_workers=settings.CONF['threadpool'])
def submit(self, func, *args, **kwargs):
"""