File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -674,12 +674,17 @@ func (cli *Client) handleHistorySyncNotificationLoop() {
674674 }
675675 }()
676676 ctx := cli .BackgroundEventCtx
677- for notif := range cli .historySyncNotifications {
678- blob , err := cli .DownloadHistorySync (ctx , notif , false )
679- if err != nil {
680- cli .Log .Errorf ("Failed to download history sync: %v" , err )
681- } else {
682- cli .dispatchEvent (& events.HistorySync {Data : blob })
677+ for {
678+ select {
679+ case notif := <- cli .historySyncNotifications :
680+ blob , err := cli .DownloadHistorySync (ctx , notif , false )
681+ if err != nil {
682+ cli .Log .Errorf ("Failed to download history sync: %v" , err )
683+ } else {
684+ cli .dispatchEvent (& events.HistorySync {Data : blob })
685+ }
686+ case <- time .After (1 * time .Minute ):
687+ return
683688 }
684689 }
685690}
You can’t perform that action at this time.
0 commit comments