loop_health_addon
messageflux.service_addons.loop_health_addon
LoopHealthAddon
an addon that can be attached to a service, to make sure he is healthy. if the service gets stuck (service loop inactivity) or has to many consecutive failures, the addons stops the service
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_consecutive_failures |
Optional[int]
|
the number of consecutive service loop failures, after which the service is stopped. None means to allow any number of failures |
None
|
max_inactivity_timeout |
Optional[float]
|
the number of seconds of inactivity (no loop ended events...) after which the service is stopped. None means to ignore inactivity. |
None
|
consecutive_failures
property
the number of consecutive failures the service has had
attach
attached the addon to a service, and returns the addon
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
service |
ServerLoopService
|
the service to attach to |
required |
LoopHealthAddonException
Bases: KwargsException
an exception that is raised on LoopHealthAddon errors