use synchronized GetParticipants to ensure eliminate timing issues upon participant join

This commit is contained in:
David Zhao
2021-01-31 23:06:48 -08:00
parent 014610bb05
commit 712d0da6cc
5 changed files with 12 additions and 21 deletions
-9
View File
@@ -1,7 +1,6 @@
package service
import (
"encoding/json"
"fmt"
"io"
"net/http"
@@ -153,14 +152,6 @@ type errStruct struct {
Message string `json:"message,omitempty"`
}
func writeJSONError(w http.ResponseWriter, code int, error ...string) {
w.Header().Set("Content-Type", "application/json; charset=utf-8")
w.Header().Set("X-Content-Type-Options", "nosniff")
w.WriteHeader(code)
json.NewEncoder(w).Encode(jsonError(code, error...))
}
func jsonError(code int, error ...string) errStruct {
es := errStruct{
StatusCode: code,