From b6b07296ae7f6a1b938d23e5b3c8ac3e9505e508 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 23 Aug 2024 10:18:26 +0200 Subject: [PATCH] [service] Do not warn when custom filter lists are not configured --- service/intel/customlists/module.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/service/intel/customlists/module.go b/service/intel/customlists/module.go index 08b21d7f..915f055e 100644 --- a/service/intel/customlists/module.go +++ b/service/intel/customlists/module.go @@ -93,7 +93,8 @@ func start() error { module.instance.Config().EventConfigChange.AddCallback( "update custom filter list", func(wc *mgr.WorkerCtx, _ struct{}) (bool, error) { - if err := checkAndUpdateFilterList(wc); !errors.Is(err, ErrNotConfigured) { + err := checkAndUpdateFilterList(wc) + if !errors.Is(err, ErrNotConfigured) { return false, err } return false, nil @@ -224,8 +225,18 @@ func New(instance instance) (*CustomList, error) { mgr: m, instance: instance, - states: mgr.NewStateMgr(m), - updateFilterListWorkerMgr: m.NewWorkerMgr("update custom filter list", checkAndUpdateFilterList, nil), + states: mgr.NewStateMgr(m), + updateFilterListWorkerMgr: m.NewWorkerMgr( + "update custom filter list", + func(ctx *mgr.WorkerCtx) error { + err := checkAndUpdateFilterList(ctx) + if !errors.Is(err, ErrNotConfigured) { + return err + } + return nil + }, + nil, + ), } if err := prep(); err != nil {