mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
Handles SIGTERM signal; resolves #827
This commit is contained in:
parent
731dac2798
commit
79cea495d7
1 changed files with 2 additions and 1 deletions
|
|
@ -21,6 +21,7 @@ import (
|
|||
"os"
|
||||
"os/signal"
|
||||
"runtime/pprof"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
|
@ -76,7 +77,7 @@ on the configured port.`,
|
|||
|
||||
// First SIGKILL causes server to shut down gracefully.
|
||||
c := make(chan os.Signal, 2)
|
||||
signal.Notify(c, os.Interrupt)
|
||||
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
||||
select {
|
||||
case sig := <-c:
|
||||
logger.Printf("Received %s; gracefully shutting down...\n", sig.String())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue