refactor: never restart scheduler worker if worker=1.

This commit is contained in:
liqiang-fit2cloud 2025-11-07 10:04:16 +08:00 committed by CaptainB
parent 1600160f4f
commit a1507c1e44

View File

@ -18,13 +18,14 @@ class SchedulerService(BaseService):
log_format = '%(h)s %(t)s %(L)ss "%(r)s" %(s)s %(b)s '
bind = f'127.0.0.1:6060'
max_requests = 10240 if self.worker > 1 else 0
cmd = [
'gunicorn', 'maxkb.wsgi:application',
'-b', bind,
'-k', 'gthread',
'--threads', '200',
'-w', str(self.worker),
'--max-requests', '10240',
'--max-requests', str(max_requests),
'--max-requests-jitter', '2048',
'--access-logformat', log_format,
'--access-logfile', '/dev/null',