rewrite of the stats system
This commit is contained in:
+3
-3
@@ -129,9 +129,9 @@ func gameStats(w http.ResponseWriter, req *http.Request) {
|
||||
http.Error(w, string(b), http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
g.winners.RLock()
|
||||
defer g.winners.RUnlock()
|
||||
if err := json.NewEncoder(w).Encode(g.winners.m); err != nil {
|
||||
g.stats.RLock()
|
||||
defer g.stats.RUnlock()
|
||||
if err := json.NewEncoder(w).Encode(g.stats); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user