diff --git a/lib/galaxy/model/database_heartbeat.py b/lib/galaxy/model/database_heartbeat.py index 1aee0d81b53..84a84842db8 100644 --- a/lib/galaxy/model/database_heartbeat.py +++ b/lib/galaxy/model/database_heartbeat.py @@ -15,6 +15,8 @@ from galaxy.model.orm.now import now log = logging.getLogger(__name__) +WEBAPP = "webapp" # WorkerProcess.app_type for web apps. + class DatabaseHeartbeat: def __init__(self, application_stack, heartbeat_interval=60): @@ -87,13 +89,15 @@ class DatabaseHeartbeat: worker_process = session.scalars(stmt).first() if not worker_process: worker_process = WorkerProcess(server_name=self.server_name, hostname=self.hostname) + if self.application_stack.app.is_webapp: + worker_process.app_type = WEBAPP worker_process.update_time = now() worker_process.pid = self.pid session.add(worker_process) # We only want a single process watching the various config files on the file system. # We just pick the max server name for simplicity is_config_watcher = self.server_name == max( - p.server_name for p in self.get_active_processes(self.heartbeat_interval + 1) + p.server_name for p in self.get_active_processes(self.heartbeat_interval + 1) if p.app_type == WEBAPP ) if is_config_watcher != self.is_config_watcher: self.is_config_watcher = is_config_watcher