Support for global.messageQueueTimeInSeconds

This commit is contained in:
Fedor Indutny 2024-10-15 15:43:06 -07:00 committed by GitHub
parent 568c09c579
commit f5257ed5a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 57 additions and 31 deletions

View file

@ -0,0 +1,18 @@
// Copyright 2024 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as RemoteConfig from '../RemoteConfig';
import { MONTH, SECOND } from './durations';
import { parseIntWithFallback } from './parseIntWithFallback';
export function getMessageQueueTime(): number {
return (
Math.max(
parseIntWithFallback(
RemoteConfig.getValue('global.messageQueueTimeInSeconds'),
MONTH / SECOND
),
MONTH / SECOND
) * SECOND
);
}