mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-09 20:37:52 +00:00
Merge pull request #830 from yuce/827-sigterm
Handles SIGTERM signal; resolves #827
This commit is contained in:
commit
6993a395ae
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