Browse Source

Handle SIGTERM signal

Frédéric Guillot 8 years ago
parent
commit
d2b137d038
1 changed files with 2 additions and 0 deletions
  1. 2 0
      daemon/daemon.go

+ 2 - 0
daemon/daemon.go

@@ -8,6 +8,7 @@ import (
 	"context"
 	"os"
 	"os/signal"
+	"syscall"
 	"time"
 
 	"github.com/miniflux/miniflux/config"
@@ -23,6 +24,7 @@ func Run(cfg *config.Config, store *storage.Storage) {
 
 	stop := make(chan os.Signal, 1)
 	signal.Notify(stop, os.Interrupt)
+	signal.Notify(stop, syscall.SIGTERM)
 
 	feedHandler := feed.NewFeedHandler(store)
 	pool := scheduler.NewWorkerPool(feedHandler, cfg.GetInt("WORKER_POOL_SIZE", config.DefaultWorkerPoolSize))