Improve start and shutdown controls and flow

This commit is contained in:
Daniel
2024-11-07 16:20:58 +01:00
parent 9f148f9ea3
commit c22814e6e1
7 changed files with 355 additions and 234 deletions

View File

@@ -80,7 +80,7 @@ func start() error {
// Add config listener to enable/disable SPN.
module.instance.Config().EventConfigChange.AddCallback("spn enable check", func(wc *mgr.WorkerCtx, s struct{}) (bool, error) {
// Do not do anything when we are shutting down.
if module.instance.Stopping() {
if module.instance.IsShuttingDown() {
return true, nil
}
@@ -255,5 +255,5 @@ func New(instance instance) (*Access, error) {
type instance interface {
Config() *config.Config
SPNGroup() *mgr.ExtendedGroup
Stopping() bool
IsShuttingDown() bool
}