fix(GODT-2803): Separate conditions to pause event loop for IMAP

Add two separate toggles to control event loop pausing. This is required
to prevent cases where the bridge requests the event loop to be paused
but a sync process completes and resumes the event loop.

For the loop to resume now both states need to be set to false. This
will be removed once GODT-2848 is implemented.
This commit is contained in:
Leander Beernaert
2023-08-11 11:23:28 +02:00
parent a5500629e5
commit 24331f9715
5 changed files with 34 additions and 4 deletions

View File

@ -38,7 +38,8 @@ import (
type EventProvider interface {
userevents.Subscribable
userevents.EventController
PauseIMAP()
ResumeIMAP()
}
type Telemetry interface {
@ -362,7 +363,7 @@ func (s *Service) run(ctx context.Context) { //nolint gocyclo
}
s.log.Info("Sync complete, starting API event stream")
s.eventProvider.Resume()
s.eventProvider.ResumeIMAP()
}
case update, ok := <-s.syncHandler.updater.ch: