Skip to content

Commit ef83266

Browse files
MatrixNeoKozakxyproto
authored andcommitted
feat: allow SIGUSR2 to clear the cache
1 parent 1184961 commit ef83266

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

platformdep/signals_unix.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import (
88
"syscall"
99
)
1010

11-
// SetupSignals installs a SIGUSR1 handler that invokes clearCacheFunction in
11+
// SetupSignals installs SIGUSR1/SIGUSR2 handlers that invoke clearCacheFunction in
1212
// a goroutine. printFunction is used to log the received signal.
1313
func SetupSignals(clearCacheFunction func(), printFunction func(format string, args ...any)) {
14-
// Listen for SIGUSR1 to clear the cache
14+
// Listen for SIGUSR1 and SIGUSR2 to clear the cache
1515
signals := make(chan os.Signal, 1)
16-
signal.Notify(signals, syscall.SIGUSR1)
16+
signal.Notify(signals, syscall.SIGUSR1, syscall.SIGUSR2)
1717
go func() {
1818
for {
1919
// Wait for a signal of the type given to signal.Notify

0 commit comments

Comments
 (0)