defer at right place

pull/1458/head
Darien Raymond 2018-12-04 14:16:31 +01:00
parent 0bc22154e5
commit d4613f156b
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 1 additions and 1 deletions

View File

@ -109,7 +109,6 @@ func main() {
// Configuration error. Exit with a special value to prevent systemd from restarting.
os.Exit(23)
}
defer server.Close()
if *test {
fmt.Println("Configuration OK.")
@ -120,6 +119,7 @@ func main() {
fmt.Println("Failed to start", err)
os.Exit(-1)
}
defer server.Close()
// Explicitly triggering GC to remove garbage from config loading.
runtime.GC()