Commit a229b537e2cf2a7d29a20c6ee2a1aec6cfcc8cce

Authored by 陆恒
1 parent a509ac43
Exists in ver2.3.0 and in 1 other branch ver2.2.8

提交

Showing 1 changed file with 5 additions and 0 deletions   Show diff stats
src/HttpServer/logic/logic.go
@@ -10,8 +10,11 @@ import ( @@ -10,8 +10,11 @@ import (
10 "net/http" 10 "net/http"
11 "strconv" 11 "strconv"
12 "strings" 12 "strings"
  13 + "sync"
13 ) 14 )
14 15
  16 +var llock sync.Mutex
  17 +
15 func HandlerQueryguaninfo(w http.ResponseWriter, data string, uuid int) { 18 func HandlerQueryguaninfo(w http.ResponseWriter, data string, uuid int) {
16 SetHeader(w) 19 SetHeader(w)
17 var resp QueryguaninfoResp 20 var resp QueryguaninfoResp
@@ -725,6 +728,8 @@ func HandlerQuerytaskinfo(w http.ResponseWriter, data string, uuid int) { @@ -725,6 +728,8 @@ func HandlerQuerytaskinfo(w http.ResponseWriter, data string, uuid int) {
725 728
726 func HandlerUpdatetaskandachieve(w http.ResponseWriter, data string, uuid int) { 729 func HandlerUpdatetaskandachieve(w http.ResponseWriter, data string, uuid int) {
727 SetHeader(w) 730 SetHeader(w)
  731 + llock.Lock()
  732 + defer llock.Unlock()
728 var resp UpdatetaskResp 733 var resp UpdatetaskResp
729 resp.Code = 0 734 resp.Code = 0
730 var rdata UpdatetaskReq 735 var rdata UpdatetaskReq