mirror of
https://github.com/SukkaW/Surge.git
synced 2026-02-03 20:41:52 +08:00
Perf: use Bun.peek() to save a few ticks
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { TTL, fsCache } from './lib/cache-filesystem';
|
||||
import { TTL, fsFetchCache } from './lib/cache-filesystem';
|
||||
import { defaultRequestInit, fetchWithRetry } from './lib/fetch-retry';
|
||||
import { createMemoizedPromise } from './lib/memo-promise';
|
||||
import { traceAsync } from './lib/trace-runner';
|
||||
|
||||
export const getPublicSuffixListTextPromise = createMemoizedPromise(() => traceAsync(
|
||||
'obtain public_suffix_list',
|
||||
() => fsCache.apply(
|
||||
() => fsFetchCache.apply(
|
||||
'https://publicsuffix.org/list/public_suffix_list.dat',
|
||||
() => fetchWithRetry('https://publicsuffix.org/list/public_suffix_list.dat', defaultRequestInit).then(r => r.text()),
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user