Skip to content

Commit bd025c6

Browse files
authored
fix(core): fix double call to StartWorkers() function when policy are reloaded (#59)
Signed-off-by: Mauro Sardara <[email protected]>
1 parent 564d3f0 commit bd025c6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/policyengine/policyengine.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ func (s *PolicyEngine) Init(conf map[string]interface{}) (err error) {
9494
logger.Error.Printf("Unable to compile local policies from directory %s, %v", s.config.PoliciesPath, err)
9595
return
9696
}
97+
98+
// start workers
99+
s.pi.StartWorkers()
97100
} else {
98101
s.policyMonitor, err = monitor.NewPolicyMonitor(s.config, s.createPolicyInterpreter, s.out)
99102
if err != nil {
@@ -197,9 +200,6 @@ func (s *PolicyEngine) createPolicyInterpreter() (*engine.PolicyInterpreter[*com
197200
return nil, err
198201
}
199202

200-
// start workers
201-
pi.StartWorkers()
202-
203203
return pi, nil
204204
}
205205

0 commit comments

Comments
 (0)