mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-15 02:55:14 +00:00
refactor: complete conversion of log calls to slog (#787)
This commit is contained in:
committed by
GitHub
parent
78266e3e4c
commit
42a861d206
@@ -2,7 +2,7 @@ package signals
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"log/slog"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
@@ -28,11 +28,11 @@ func SignalContext(parentCtx context.Context) context.Context {
|
||||
signal.Notify(sigCh, os.Interrupt, syscall.SIGTERM)
|
||||
go func() {
|
||||
<-sigCh
|
||||
log.Println("Received interrupt signal. Shutting down…")
|
||||
slog.Info("Received interrupt signal. Shutting down…")
|
||||
cancel()
|
||||
|
||||
<-sigCh
|
||||
log.Println("Received a second interrupt signal. Forcing an immediate shutdown.")
|
||||
slog.Warn("Received a second interrupt signal. Forcing an immediate shutdown.")
|
||||
os.Exit(1)
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user