mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-19 16:46:55 +00:00
feat(GODT-2828): Increase sync progress report frequency
We now report sync progress after a batch completes each stage.
This commit is contained in:
@ -108,6 +108,10 @@ func (j *Job) onError(err error) {
|
||||
j.cancel()
|
||||
}
|
||||
|
||||
func (j *Job) onStageCompleted(ctx context.Context, count int64) {
|
||||
j.syncReporter.OnProgress(ctx, count)
|
||||
}
|
||||
|
||||
func (j *Job) onJobFinished(ctx context.Context, lastMessageID string, count int64) {
|
||||
defer j.wg.Done()
|
||||
|
||||
@ -219,6 +223,10 @@ func (s *childJob) onFinished(ctx context.Context) {
|
||||
s.job.downloadCache.DeleteAttachments(s.cachedAttachmentIDs...)
|
||||
}
|
||||
|
||||
func (s *childJob) onStageCompleted(ctx context.Context) {
|
||||
s.job.onStageCompleted(ctx, s.messageCount)
|
||||
}
|
||||
|
||||
func (s *childJob) checkCancelled() bool {
|
||||
err := s.job.ctx.Err()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user