mirror of
https://github.com/warmbly/warmbly.git
synced 2026-11-28 16:06:08 +00:00
25 lines
719 B
Go
25 lines
719 B
Go
package jobs
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/warmbly/warmbly/internal/models"
|
|
)
|
|
|
|
// HandleGraphDeltaUpdate persists the opaque per-folder Microsoft Graph delta
|
|
// cursor relayed by the worker, so the mailbox resumes from its last position on
|
|
// the next (re)assignment instead of re-priming.
|
|
func (s *JobsService) HandleGraphDeltaUpdate(ctx context.Context, e *models.JobEventGraphDeltaUpdate) error {
|
|
if s.EmailGraphDeltaRepository == nil {
|
|
return nil
|
|
}
|
|
if err := s.EmailGraphDeltaRepository.Put(ctx, e.UserID, e.EmailID, e.Folder, e.DeltaLink); err != nil {
|
|
if s.dropForDeletedMailbox(ctx, e.UserID, e.EmailID, err) {
|
|
return nil
|
|
}
|
|
CaptureError(e.UserID, e.EmailID, err)
|
|
return err
|
|
}
|
|
return nil
|
|
}
|