WIP
This commit is contained in:
@@ -167,10 +167,6 @@ func New(svcCfg *ServiceConfig) (*Instance, error) { //nolint:maintidx
|
||||
}
|
||||
|
||||
// Service modules
|
||||
instance.core, err = core.New(instance)
|
||||
if err != nil {
|
||||
return instance, fmt.Errorf("create core module: %w", err)
|
||||
}
|
||||
binaryUpdateConfig, intelUpdateConfig, err := MakeUpdateConfigs(svcCfg)
|
||||
if err != nil {
|
||||
return instance, fmt.Errorf("create updates config: %w", err)
|
||||
@@ -183,6 +179,10 @@ func New(svcCfg *ServiceConfig) (*Instance, error) { //nolint:maintidx
|
||||
if err != nil {
|
||||
return instance, fmt.Errorf("create updates module: %w", err)
|
||||
}
|
||||
instance.core, err = core.New(instance)
|
||||
if err != nil {
|
||||
return instance, fmt.Errorf("create core module: %w", err)
|
||||
}
|
||||
instance.geoip, err = geoip.New(instance)
|
||||
if err != nil {
|
||||
return instance, fmt.Errorf("create customlist module: %w", err)
|
||||
@@ -708,3 +708,23 @@ func (i *Instance) ShutdownComplete() <-chan struct{} {
|
||||
func (i *Instance) ExitCode() int {
|
||||
return int(i.exitCode.Load())
|
||||
}
|
||||
|
||||
// ShouldRestartIsSet returns whether the service/instance should be restarted.
|
||||
func (i *Instance) ShouldRestartIsSet() bool {
|
||||
return i.ShouldRestart
|
||||
}
|
||||
|
||||
// CommandLineOperationIsSet returns whether the command line option is set.
|
||||
func (i *Instance) CommandLineOperationIsSet() bool {
|
||||
return i.CommandLineOperation != nil
|
||||
}
|
||||
|
||||
// CommandLineOperationExecute executes the set command line option.
|
||||
func (i *Instance) CommandLineOperationExecute() error {
|
||||
return i.CommandLineOperation()
|
||||
}
|
||||
|
||||
// AddModule adds a module to the service group.
|
||||
func (i *Instance) AddModule(m mgr.Module) {
|
||||
i.serviceGroup.Add(m)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user