mirror of
https://github.com/pockethost/pockethost.git
synced 2025-06-04 13:16:41 +00:00
chore(pockethost): rename TryCatchConfig
This commit is contained in:
parent
b55b3651da
commit
d34a2f62b5
@ -3,7 +3,7 @@ import { LoggerService } from '../common'
|
||||
|
||||
export const TRYFETCH_RETRY_MS = 50
|
||||
|
||||
export type Config = {
|
||||
export type TryFetchConfig = {
|
||||
preflight: () => Promise<boolean>
|
||||
retryMs: number
|
||||
}
|
||||
@ -21,8 +21,11 @@ export type Config = {
|
||||
*
|
||||
* Note: tryFetch exits ONLY on success or a rejected preflight.
|
||||
*/
|
||||
export const tryFetch = async (url: string, config?: Partial<Config>) => {
|
||||
const { preflight, retryMs }: Config = {
|
||||
export const tryFetch = async (
|
||||
url: string,
|
||||
config?: Partial<TryFetchConfig>,
|
||||
) => {
|
||||
const { preflight, retryMs }: TryFetchConfig = {
|
||||
preflight: async () => true,
|
||||
retryMs: TRYFETCH_RETRY_MS,
|
||||
...config,
|
||||
|
Loading…
x
Reference in New Issue
Block a user