Add log for signal received

This commit is contained in:
Deluan 2022-12-02 20:30:23 -05:00
parent 5713010984
commit 9ffd145e82
2 changed files with 2 additions and 0 deletions

View file

@ -18,6 +18,7 @@ func startSignaler(ctx context.Context) func() error {
signal.Notify(sigChan, os.Interrupt) signal.Notify(sigChan, os.Interrupt)
select { select {
case <-sigChan: case <-sigChan:
log.Info(ctx, "Received termination signal", "signal", sig)
return interrupted return interrupted
case <-ctx.Done(): case <-ctx.Done():
return nil return nil

View file

@ -33,6 +33,7 @@ func startSignaler(ctx context.Context) func() error {
select { select {
case sig := <-sigChan: case sig := <-sigChan:
if sig != triggerScanSignal { if sig != triggerScanSignal {
log.Info(ctx, "Received termination signal", "signal", sig)
return interrupted return interrupted
} }
log.Info(ctx, "Received signal, triggering a new scan", "signal", sig) log.Info(ctx, "Received signal, triggering a new scan", "signal", sig)