Spaces:
Build error
Build error
chore: update rate limits
Browse files
backend/functions/src/cloud-functions/crawler.ts
CHANGED
|
@@ -375,8 +375,8 @@ ${this.content}
|
|
| 375 |
|
| 376 |
const apiRoll = await this.rateLimitControl.simpleRPCUidBasedLimit(rpcReflect, uid, ['CRAWL'],
|
| 377 |
[
|
| 378 |
-
//
|
| 379 |
-
new Date(Date.now() - 60 * 1000),
|
| 380 |
]
|
| 381 |
);
|
| 382 |
|
|
@@ -393,8 +393,8 @@ ${this.content}
|
|
| 393 |
} else if (ctx.req.ip) {
|
| 394 |
const apiRoll = await this.rateLimitControl.simpleRpcIPBasedLimit(rpcReflect, ctx.req.ip, ['CRAWL'],
|
| 395 |
[
|
| 396 |
-
//
|
| 397 |
-
new Date(Date.now() - 60 * 1000),
|
| 398 |
]
|
| 399 |
);
|
| 400 |
|
|
|
|
| 375 |
|
| 376 |
const apiRoll = await this.rateLimitControl.simpleRPCUidBasedLimit(rpcReflect, uid, ['CRAWL'],
|
| 377 |
[
|
| 378 |
+
// 200 requests per minute
|
| 379 |
+
new Date(Date.now() - 60 * 1000), 200
|
| 380 |
]
|
| 381 |
);
|
| 382 |
|
|
|
|
| 393 |
} else if (ctx.req.ip) {
|
| 394 |
const apiRoll = await this.rateLimitControl.simpleRpcIPBasedLimit(rpcReflect, ctx.req.ip, ['CRAWL'],
|
| 395 |
[
|
| 396 |
+
// 20 requests per minute
|
| 397 |
+
new Date(Date.now() - 60 * 1000), 20
|
| 398 |
]
|
| 399 |
);
|
| 400 |
|
backend/functions/src/cloud-functions/searcher.ts
CHANGED
|
@@ -153,8 +153,8 @@ export class SearcherHost extends RPCHost {
|
|
| 153 |
|
| 154 |
await this.rateLimitControl.simpleRPCUidBasedLimit(rpcReflect, uid, ['CRAWL'],
|
| 155 |
[
|
| 156 |
-
//
|
| 157 |
-
new Date(Date.now() - 60 * 1000),
|
| 158 |
]
|
| 159 |
);
|
| 160 |
|
|
@@ -169,8 +169,8 @@ export class SearcherHost extends RPCHost {
|
|
| 169 |
this.threadLocal.set('ip', ctx.req.ip);
|
| 170 |
await this.rateLimitControl.simpleRpcIPBasedLimit(rpcReflect, ctx.req.ip, ['CRAWL'],
|
| 171 |
[
|
| 172 |
-
//
|
| 173 |
-
new Date(Date.now() - 60 * 1000),
|
| 174 |
]
|
| 175 |
);
|
| 176 |
}
|
|
|
|
| 153 |
|
| 154 |
await this.rateLimitControl.simpleRPCUidBasedLimit(rpcReflect, uid, ['CRAWL'],
|
| 155 |
[
|
| 156 |
+
// 40 requests per minute
|
| 157 |
+
new Date(Date.now() - 60 * 1000), 40
|
| 158 |
]
|
| 159 |
);
|
| 160 |
|
|
|
|
| 169 |
this.threadLocal.set('ip', ctx.req.ip);
|
| 170 |
await this.rateLimitControl.simpleRpcIPBasedLimit(rpcReflect, ctx.req.ip, ['CRAWL'],
|
| 171 |
[
|
| 172 |
+
// 5 requests per minute
|
| 173 |
+
new Date(Date.now() - 60 * 1000), 5
|
| 174 |
]
|
| 175 |
);
|
| 176 |
}
|