signal-desktop/ts/util/getMessageQueueTime.ts
automated-signal 6cc07a4d17
Support for global.messageQueueTimeInSeconds
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
2024-10-15 16:12:03 -07:00

18 lines
484 B
TypeScript

// 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
);
}