Add incr on block.
This commit is contained in:
1 parent
968574dda1
commit
7e587198dd
2 files changed
+8
No files matched your search
@@ -99,6 +99,8 @@ export async function findSession(req: NextApiRequestCollect) {
|
||||
|
||||
async function checkUserBlock(userId: string) {
|
||||
if (process.env.ENABLE_BLOCKER && (await cache.fetchUserBlock(userId))) {
|
||||
await cache.incrementUserBlock(userId);
|
||||
|
||||
throw new Error('Usage Limit.');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user