Enable more specific AttachmentDownload prioritization

This commit is contained in:
trevor-signal 2024-04-15 20:11:48 -04:00 committed by GitHub
parent 87ea909ae9
commit fc02762588
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 2245 additions and 817 deletions

View file

@ -25,6 +25,21 @@ describe('exponential backoff utilities', () => {
assert.strictEqual(exponentialBackoffSleepTime(attempt), maximum);
}
});
it('respects custom variables', () => {
const options = {
maxBackoffTime: 10000,
multiplier: 2,
firstBackoffTime: 1000,
};
assert.strictEqual(exponentialBackoffSleepTime(1, options), 0);
assert.strictEqual(exponentialBackoffSleepTime(2, options), 1000);
assert.strictEqual(exponentialBackoffSleepTime(3, options), 2000);
assert.strictEqual(exponentialBackoffSleepTime(4, options), 4000);
assert.strictEqual(exponentialBackoffSleepTime(5, options), 8000);
assert.strictEqual(exponentialBackoffSleepTime(6, options), 10000);
assert.strictEqual(exponentialBackoffSleepTime(7, options), 10000);
});
});
describe('exponentialBackoffMaxAttempts', () => {