Merge branch 'main' of gitea.psi.ch:sls/hla_framework_bd into feature/add-service-dbpm3curr
This commit is contained in:
@@ -39,6 +39,13 @@ class BaseService(Generic[T]):
|
||||
"""Override this method in child classes to implement service logic."""
|
||||
raise NotImplementedError("Subclasses must implement the update() loop.")
|
||||
|
||||
def on_transition_to_paused(self):
|
||||
"""
|
||||
Override this method in child classes to implement custom logic when a
|
||||
service is transitioned to paused. Does nothing by default.
|
||||
"""
|
||||
pass
|
||||
|
||||
def transition_to_running(self):
|
||||
self.status = ServiceStatus.RUNNING
|
||||
self.pvs.status.put("running")
|
||||
@@ -46,6 +53,7 @@ class BaseService(Generic[T]):
|
||||
def transition_to_paused(self):
|
||||
self.status = ServiceStatus.PAUSED
|
||||
self.pvs.status.put("paused")
|
||||
self.on_transition_to_paused()
|
||||
|
||||
def finalize_termination(self):
|
||||
"""Determines the exit reason and safely alerts the ALH watchdogs."""
|
||||
|
||||
Reference in New Issue
Block a user