From d2b137d0386d89fd3f3cef333b9a6fd1d5ab4148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Tue, 2 Jan 2018 22:40:26 -0800 Subject: [PATCH] Handle SIGTERM signal --- daemon/daemon.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daemon/daemon.go b/daemon/daemon.go index 494e0356..1fb99b1e 100644 --- a/daemon/daemon.go +++ b/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))