mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-19 08:37:06 +00:00
fix(GODT-2822): retry 429 for metadata and exponential cooldown GODT-2823.
This commit is contained in:
@ -103,7 +103,7 @@ func startSyncDownloader(
|
||||
return
|
||||
}
|
||||
|
||||
batch, err := downloadMessagesStage2(ctx, result, downloader, cache, SyncRetryCooldown)
|
||||
batch, err := downloadMessagesStage2(ctx, result, downloader, cache, &expCooldown{})
|
||||
if err != nil {
|
||||
errorCh <- err
|
||||
return
|
||||
@ -281,7 +281,7 @@ func downloadMessagesStage2(
|
||||
state []downloadResult,
|
||||
downloader MessageDownloader,
|
||||
cache *SyncDownloadCache,
|
||||
coolDown time.Duration,
|
||||
cooldown cooldownProvider,
|
||||
) ([]proton.FullMessage, error) {
|
||||
logrus.Debug("Entering download stage 2")
|
||||
var retryList []int
|
||||
@ -289,7 +289,7 @@ func downloadMessagesStage2(
|
||||
|
||||
for {
|
||||
if shouldWaitBeforeRetry {
|
||||
time.Sleep(coolDown)
|
||||
time.Sleep(cooldown.GetNextWaitTime())
|
||||
}
|
||||
|
||||
retryList = nil
|
||||
|
||||
Reference in New Issue
Block a user