Increase delay

This commit is contained in:
Neeraj Gupta
2024-11-29 12:47:22 +05:30
parent c6ec3fa8fd
commit 002b148dae

View File

@@ -27,8 +27,9 @@ import (
)
const (
slowUploadThreshold = 2 * time.Second
slowSpeedThreshold = 0.5 // MB/s
slowUploadThreshold = 2 * time.Second
slowSpeedThreshold = 0.5 // MB/s
replicationDelayForStaleObjects = 30
)
// ReplicationController3 oversees version 3 of our object replication.
@@ -251,11 +252,11 @@ func (c *ReplicationController3) tryReplicate() error {
}
if strings.Contains(err.Error(), "size of the uploaded file") {
delayErr := c.ObjectCopiesRepo.DelayNextAttemptByDays(context.Background(), objectKey, 7)
delayErr := c.ObjectCopiesRepo.DelayNextAttemptByDays(context.Background(), objectKey, replicationDelayForStaleObjects)
if delayErr != nil {
logger.WithError(delayErr).Error("Failed to delay next attempt by 7 days")
logger.WithError(delayErr).Error("Failed to delay next attempt")
} else {
discordAlert := fmt.Sprintf("🔥 Size mismatch for object %s, failed to delay next attempt by 7 days", objectKey)
discordAlert := fmt.Sprintf("🔥 Size mismatch for object %s, deferred next attemp for %d days", objectKey, replicationDelayForStaleObjects)
c.notifyDiscord(discordAlert)
}
}