refactor: never restart scheduler worker if worker=1.

v3.2
liqiang-fit2cloud 2025-11-07 10:04:16 +08:00
parent ea2c2f9e2b
commit 207a67dcc2
1 changed files with 2 additions and 1 deletions

View File

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