increased chat fetching

This commit is contained in:
cryptonote-social 2020-12-26 08:32:54 -08:00
parent 755be8eab5
commit 25333c6e38
2 changed files with 7 additions and 7 deletions

View File

@ -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])

View File

@ -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)