mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Improve graceful shutdown
This commit is contained in:
parent
0429bbb19d
commit
657e96e133
1 changed files with 3 additions and 1 deletions
|
@ -54,7 +54,9 @@ func Run(cfg *config.Config, store *storage.Storage) {
|
||||||
|
|
||||||
<-stop
|
<-stop
|
||||||
logger.Info("Shutting down the server...")
|
logger.Info("Shutting down the server...")
|
||||||
ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
server.Shutdown(ctx)
|
server.Shutdown(ctx)
|
||||||
store.Close()
|
store.Close()
|
||||||
logger.Info("Server gracefully stopped")
|
logger.Info("Server gracefully stopped")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue