mirror of
https://github.com/cryptonote-social/csminer.git
synced 2024-08-15 16:30:37 +03:00
increased chat fetching
This commit is contained in:
parent
755be8eab5
commit
25333c6e38
@ -54,15 +54,15 @@ func ChatSent(id int) {
|
||||
}
|
||||
|
||||
func ChatsReceived(chats []client.ChatResult, chatToken int, fetchedToken int) {
|
||||
if len(chats) == 0 {
|
||||
return
|
||||
if len(chats) != 0 {
|
||||
crylog.Info("Chats received:", chats)
|
||||
}
|
||||
crylog.Info("Chats received:", chats)
|
||||
mutex.Lock()
|
||||
defer mutex.Unlock()
|
||||
if nextToken != fetchedToken {
|
||||
crylog.Warn("Skipping dupe chats:", chats)
|
||||
return // these chats are already handled
|
||||
// Another chat request must have succeeded before this one.
|
||||
crylog.Warn("chats updated since this fetch, discarding:", chats)
|
||||
return
|
||||
}
|
||||
for i := range chats {
|
||||
receivedQueue = append(receivedQueue, &chats[i])
|
||||
|
@ -390,6 +390,7 @@ func MiningLoop(jobChan <-chan *client.MultiClientJob, done chan<- bool) {
|
||||
}
|
||||
|
||||
case <-time.After(30 * time.Second):
|
||||
go GetChats()
|
||||
break
|
||||
}
|
||||
|
||||
@ -695,8 +696,7 @@ func goMine(job client.MultiClientJob, thread int) {
|
||||
crylog.Warn("Didn't get pool stats in response:", resp.Result)
|
||||
updatePoolStats(true)
|
||||
}
|
||||
//crylog.Info("Chat token:", resp.ChatToken, chat.NextToken())
|
||||
if resp.ChatToken > 0 && resp.ChatToken != chat.NextToken() {
|
||||
if resp.ChatToken != chat.NextToken() {
|
||||
go GetChats()
|
||||
}
|
||||
}(fnonce, job.JobID)
|
||||
|
Loading…
Reference in New Issue
Block a user