mirror of
https://github.com/statbate/animated-sniffle.git
synced 2026-08-11 02:12:41 +00:00
update
This commit is contained in:
parent
7023da390f
commit
53e34904b0
1 changed files with 10 additions and 2 deletions
|
|
@ -188,11 +188,11 @@ func xWorker(workerData Info, u url.URL) {
|
|||
|
||||
slog <- saveLog{workerData.Rid, time.Now().Unix(), string(message)}
|
||||
|
||||
quit := make(chan bool)
|
||||
quit := make(chan struct{})
|
||||
pid := 3
|
||||
|
||||
defer func() {
|
||||
quit <- true
|
||||
close(quit)
|
||||
}()
|
||||
|
||||
go func() {
|
||||
|
|
@ -214,6 +214,8 @@ func xWorker(workerData Info, u url.URL) {
|
|||
}
|
||||
}()
|
||||
|
||||
dons := make(map[string]struct{})
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-workerData.ch:
|
||||
|
|
@ -258,6 +260,12 @@ func xWorker(workerData Info, u url.URL) {
|
|||
if err = json.Unmarshal(m.Body, d); err == nil {
|
||||
//fmt.Println(d.F.Username, "send", d.A, "tokens")
|
||||
|
||||
workerData.Tips++
|
||||
if _, ok := dons[d.F.Username]; !ok {
|
||||
dons[d.F.Username] = struct{}{}
|
||||
workerData.Dons++
|
||||
}
|
||||
|
||||
save <- saveData{workerData.room, d.F.Username, workerData.Rid, d.A, now}
|
||||
|
||||
workerData.Income += d.A
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue