Skip to content

Commit 3d227e0

Browse files
Update worker limit (#1405)
* Update worker limit * Handle error for when a mapping has no routes
1 parent 0f91503 commit 3d227e0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/backend/src/services/worker/WorkerService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ class WorkerService extends BaseService {
198198
const currentDomains = await svc_su.sudo(Context.get("actor").get_related_actor(UserActorType), async () => {
199199
return (await es_subdomain.select({ predicate: new StartsWith({ key: "subdomain", value: "workers.puter." }) }));
200200
});
201-
if (currentDomains.length >= 10) {
202-
throw APIError.create('subdomain_limit_reached', null, {isWorker: true, limit: 10});
201+
if (currentDomains.length >= 100) {
202+
throw APIError.create('subdomain_limit_reached', null, {isWorker: true, limit: 100});
203203
}
204204

205205
if (this.global_config.reserved_words.includes(workerName)) {

src/backend/src/services/worker/src/s2w-router.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ function inits2w() {
7878
if (this.handleCors && event.request.method === "OPTIONS" && !mappings) {
7979
return this.handleOptions(event.request);
8080
}
81+
if (!mappings) {
82+
return new Response(`No routes for given request type ${event.request.method}`, {status: 404});
83+
}
8184
const url = new URL(event.request.url);
8285
try {
8386
for (const mapping of mappings) {

0 commit comments

Comments
 (0)