mirror of
https://github.com/jech/galene.git
synced 2024-11-23 00:55:58 +01:00
Create webserver structure in main thread.
Avoids a race.
This commit is contained in:
parent
71022f4b58
commit
8d58571d4c
1 changed files with 12 additions and 12 deletions
|
@ -41,7 +41,6 @@ func webserver() {
|
||||||
http.HandleFunc("/public-groups.json", publicHandler)
|
http.HandleFunc("/public-groups.json", publicHandler)
|
||||||
http.HandleFunc("/stats", statsHandler)
|
http.HandleFunc("/stats", statsHandler)
|
||||||
|
|
||||||
go func() {
|
|
||||||
server = &http.Server{
|
server = &http.Server{
|
||||||
Addr: httpAddr,
|
Addr: httpAddr,
|
||||||
ReadHeaderTimeout: 60 * time.Second,
|
ReadHeaderTimeout: 60 * time.Second,
|
||||||
|
@ -54,6 +53,7 @@ func webserver() {
|
||||||
go g.shutdown("server is shutting down")
|
go g.shutdown("server is shutting down")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
go func() {
|
||||||
var err error
|
var err error
|
||||||
err = server.ListenAndServeTLS(
|
err = server.ListenAndServeTLS(
|
||||||
filepath.Join(dataDir, "cert.pem"),
|
filepath.Join(dataDir, "cert.pem"),
|
||||||
|
|
Loading…
Reference in a new issue