MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / ensurePLimit

Function ensurePLimit

aban/aban.ts:21–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19
20// p-limit 是 ESM-only,必须动态加载
21let pLimit: typeof import("p-limit").default;
22let pLimitReady: Promise<void> | null = null;
23async function ensurePLimit(): Promise<typeof pLimit> {
24 if (pLimit) return pLimit;
25 if (!pLimitReady) {
26 pLimitReady = (async () => {
27 try {
28 npm_install("p-limit");
29 } catch {}
30 pLimit = (await import("p-limit")).default;
31 })();
32 }
33 await pLimitReady;
34 return pLimit;
35}
36

Callers 4

batchBanUserMethod · 0.85
batchUnbanUserMethod · 0.85
handleSuperBanMethod · 0.85
handleSuperUnbanMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected