-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
消息有延迟感,建议发送信息后, 立即显示在聊天窗口,后台判断是否发送成功。 #28
Comments
好的,感谢您的建议 |
1 similar comment
好的,感谢您的建议 |
延迟得原因:我这里有一个情况是 auth鉴权的时候,使用redis,但是redis响应特别长。导致消息延迟或者发送失败。 |
// https://github.com/redis/go-redis/issues/181
ticker := time.NewTicker(time.Duration(55) * time.Second)
//this is to send "ping" request each second for health-check
go func() {
for {
select {
case <-ticker.C:
//send heart-beat signal to check if everything is ok
if _, err := client.Ping(context.TODO()).Result(); err != nil {
log.Errorf("unable to ping redis, error: %+v", err)
} else {
//log.Debug("heartbeat ok!")
}
}
}
}() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
消息有延迟感,建议发送信息后, 立即显示在聊天窗口,后台判断是否发送成功。
就像QQ 微信一样, 如果发送失败 显示
The text was updated successfully, but these errors were encountered: