mirror of
https://github.com/go-shiori/shiori.git
synced 2025-01-17 05:17:59 +08:00
Merge pull request #52 from peteretelej/fix/timeouts
Set server timeouts
This commit is contained in:
commit
d0fc6a5525
1 changed files with 7 additions and 1 deletions
|
@ -74,7 +74,13 @@ var (
|
|||
port, _ := cmd.Flags().GetInt("port")
|
||||
url := fmt.Sprintf(":%d", port)
|
||||
logrus.Infoln("Serve shiori in", url)
|
||||
logrus.Fatalln(http.ListenAndServe(url, router))
|
||||
svr := &http.Server{
|
||||
Addr: url,
|
||||
Handler: router,
|
||||
ReadTimeout: 10 * time.Second,
|
||||
WriteTimeout: 20 * time.Second,
|
||||
}
|
||||
logrus.Fatalln(svr.ListenAndServe())
|
||||
},
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue