Enable more specific AttachmentDownload prioritization
This commit is contained in:
parent
87ea909ae9
commit
fc02762588
26 changed files with 2245 additions and 817 deletions
|
@ -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', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue