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