The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
import {
FATHOM_MEDIA_DOWNLOAD_INITIAL_POLL_DELAY_MILLISECONDS,
FATHOM_MEDIA_DOWNLOAD_MAX_POLL_DELAY_MILLISECONDS,
FATHOM_MEDIA_DOWNLOAD_POLL_BACKOFF_EXPONENT,
} from 'src/constants/fathom.constant';
export const getFathomMediaDownloadPollDelay = (attempt: number): number =>
Math.min(
Math.round(
FATHOM_MEDIA_DOWNLOAD_INITIAL_POLL_DELAY_MILLISECONDS *
FATHOM_MEDIA_DOWNLOAD_POLL_BACKOFF_EXPONENT ** attempt,
),
FATHOM_MEDIA_DOWNLOAD_MAX_POLL_DELAY_MILLISECONDS,
);