forked from Silverfish/proton-bridge
fix(GODT-2327): Properly cancel event stream when handling refresh
This commit is contained in:
@ -85,8 +85,11 @@ func (user *User) handleRefreshEvent(ctx context.Context, refresh proton.Refresh
|
||||
l.WithError(err).Error("Failed to report refresh to sentry")
|
||||
}
|
||||
|
||||
// Cancel the event stream once this refresh is done.
|
||||
defer user.pollAbort.Abort()
|
||||
|
||||
// Cancel and restart ongoing syncs.
|
||||
user.abortable.Abort()
|
||||
user.syncAbort.Abort()
|
||||
defer user.goSync()
|
||||
|
||||
return safe.LockRet(func() error {
|
||||
|
||||
Reference in New Issue
Block a user