Increase fallback Retry-After
time to 1 minute
This commit is contained in:
parent
b6287f4839
commit
05e5786883
4 changed files with 25 additions and 20 deletions
|
@ -1,19 +1,20 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// Copyright 2021-2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { MINUTE } from '../../util/durations';
|
||||
|
||||
import { parseRetryAfter } from '../../util/parseRetryAfter';
|
||||
|
||||
describe('parseRetryAfter', () => {
|
||||
it('should return 1 second when passed non-strings', () => {
|
||||
assert.equal(parseRetryAfter(undefined), 1000);
|
||||
assert.equal(parseRetryAfter(1234), 1000);
|
||||
it('should return 1 minute when passed non-strings', () => {
|
||||
assert.equal(parseRetryAfter(undefined), MINUTE);
|
||||
assert.equal(parseRetryAfter(1234), MINUTE);
|
||||
});
|
||||
|
||||
it('should return 1 second with invalid strings', () => {
|
||||
assert.equal(parseRetryAfter('nope'), 1000);
|
||||
assert.equal(parseRetryAfter('1ff'), 1000);
|
||||
it('should return 1 minute with invalid strings', () => {
|
||||
assert.equal(parseRetryAfter('nope'), MINUTE);
|
||||
assert.equal(parseRetryAfter('1ff'), MINUTE);
|
||||
});
|
||||
|
||||
it('should return milliseconds on valid input', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue