added profiling flag and kill channel
This commit is contained in:
+11
@@ -2,7 +2,9 @@ package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
"net/http"
|
||||
"runtime/pprof"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -80,3 +82,12 @@ func stopGame(w http.ResponseWriter, req *http.Request) {
|
||||
}
|
||||
gameid.kill <- true
|
||||
}
|
||||
|
||||
func killServer(w http.ResponseWriter, req *http.Request) {
|
||||
if *profile != "" {
|
||||
log.Print("trying to stop cpu profile")
|
||||
pprof.StopCPUProfile()
|
||||
log.Print("stopped cpu profile")
|
||||
}
|
||||
log.Fatal("shit got fucked up")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user