MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / requestConcurrencyLimiter

Function requestConcurrencyLimiter

panel/src/app/middleware/limit.ts:39–47  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

37}
38
39export function requestConcurrencyLimiter(url: string) {
40 return async (ctx: Context, next: Function) => {
41 const userId = getUserUuid(ctx) || "_anonymous_";
42 const key = `UserConcurrencyLimiter:${userId}:${url}`;
43 return await execWithMutexId(key, async () => {
44 return await next();
45 });
46 };
47}

Callers 1

Calls 2

getUserUuidFunction · 0.90
execWithMutexIdFunction · 0.90

Tested by

no test coverage detected