(url: string)
| 37 | } |
| 38 | |
| 39 | export 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 | } |
no test coverage detected