mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #6836 from mvdbeek/fix_job_monitor_thread
[18.01] Register job monitor thread as postfork function
This commit is contained in:
@@ -3,6 +3,7 @@ from __future__ import absolute_import
|
||||
import logging
|
||||
import threading
|
||||
|
||||
from galaxy.web.stack import register_postfork_function
|
||||
from .sleeper import Sleeper
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@@ -27,7 +28,11 @@ class Monitors:
|
||||
self.sleeper = Sleeper()
|
||||
self.monitor_thread = threading.Thread(name=name, target=monitor_func)
|
||||
self.monitor_thread.setDaemon(True)
|
||||
if start:
|
||||
self._start = start
|
||||
register_postfork_function(self.start_monitoring)
|
||||
|
||||
def start_monitoring(self):
|
||||
if self._start:
|
||||
self.monitor_thread.start()
|
||||
|
||||
def stop_monitoring(self):
|
||||
|
||||
Reference in New Issue
Block a user