Handle SIGUSR1 to restart pool
This commit is contained in:
1 parent
2b1aff1eeb
commit
3369b3f897
1 file changed
+5
@@ -214,6 +214,10 @@ class TrytonServer(object):
|
||||
' service, port ' + str(port))
|
||||
|
||||
def handler(signum, frame):
|
||||
if signum == signal.SIGUSR1:
|
||||
for db_name in pooler.get_db_list():
|
||||
pooler.restart_pool(db_name)
|
||||
return
|
||||
if CONFIG['netrpc']:
|
||||
tinysocket.stop()
|
||||
if CONFIG['xmlrpc']:
|
||||
@@ -232,6 +236,7 @@ class TrytonServer(object):
|
||||
|
||||
signal.signal(signal.SIGINT, handler)
|
||||
signal.signal(signal.SIGTERM, handler)
|
||||
signal.signal(signal.SIGUSR1, handler)
|
||||
|
||||
self.logger.info('the server is running, waiting for connections...')
|
||||
if CONFIG['netrpc']:
|
||||
|
||||
Reference in new issue
Block a user