mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 04:36:43 +00:00
feat(GODT-2848): Decouple IMAP service from Event Loop
The IMAP service no longer blocks the event loop from progressing. When syncing the event loop continues as usual, allow other parts of the bridge to continue updating. Once the sync is complete, it resets the event id back to the last handled id before sync started and then we play catch up.
This commit is contained in:
@ -295,7 +295,8 @@ func newImpl(
|
||||
})
|
||||
|
||||
// Start Event Service
|
||||
if err := user.eventService.Start(ctx, user.serviceGroup); err != nil {
|
||||
lastEventID, err := user.eventService.Start(ctx, user.serviceGroup)
|
||||
if err != nil {
|
||||
return user, fmt.Errorf("failed to start event service: %w", err)
|
||||
}
|
||||
|
||||
@ -311,7 +312,7 @@ func newImpl(
|
||||
}
|
||||
|
||||
// Start IMAP Service
|
||||
if err := user.imapService.Start(ctx, user.serviceGroup, syncService); err != nil {
|
||||
if err := user.imapService.Start(ctx, user.serviceGroup, syncService, lastEventID); err != nil {
|
||||
return user, fmt.Errorf("failed to start imap service: %w", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user