fix(GODT-2327): Properly cancel event stream when handling refresh

This commit is contained in:
James Houlahan
2023-02-06 15:27:29 +01:00
committed by Jakub
parent ab1c1c474a
commit ca1996a670
2 changed files with 39 additions and 24 deletions

View File

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