Extend daemon stop logic to clear firewall data during testing interval expiration
This commit is contained in:
@@ -106,12 +106,19 @@ func (d *daemon) runWorker(ctx context.Context, isTesting bool, testingInterval
|
||||
return
|
||||
case <-stopTestingCh:
|
||||
d.logger.Info("Testing interval expired, stopping service")
|
||||
|
||||
if err := d.notifications.DBQueueClear(); err != nil {
|
||||
d.logger.Error(fmt.Sprintf("failed to clear notifications queue: %v", err))
|
||||
}
|
||||
|
||||
if err := d.analyzer.ClearDBData(); err != nil {
|
||||
d.logger.Error(fmt.Sprintf("failed to clear analyzer data: %v", err))
|
||||
}
|
||||
|
||||
if err := d.firewall.ClearDBData(); err != nil {
|
||||
d.logger.Error(fmt.Sprintf("failed to clear firewall data: %v", err))
|
||||
}
|
||||
|
||||
d.Stop()
|
||||
return
|
||||
case <-d.stopCh:
|
||||
|
||||
Reference in New Issue
Block a user