Skip to content

Commit

Permalink
chore(crawl): bump default crawl limiting
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Aug 28, 2022
1 parent e7f13fe commit 16c663e
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@a11ywatch/core",
"version": "0.5.44",
"version": "0.5.46",
"description": "a11ywatch central api",
"main": "./server.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/core/controllers/websites/set/add-website.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ export const addWebsite = async ({
await watcherCrawl({
url: url,
userId,
scan: true,
robots,
subdomains: subdomainsEnabled,
tld: tldEnabled,
scan: true,
});
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/core/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ export const Mutation = {
await watcherCrawl({
url: url,
userId: keyid,
scan: true,
subdomains: website?.subdomains,
tld: website?.tld,
scan: true,
});
});
return {
Expand Down
2 changes: 1 addition & 1 deletion src/core/utils/crawl-stream-slim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export const crawlHttpStreamSlim = (
setImmediate(async () => {
await watcherCrawl({
url,
scan: true,
userId,
subdomains: !!subdomains,
tld: !!tld,
scan: true,
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/core/utils/crawl-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export const crawlHttpStream = (
setImmediate(async () => {
await watcherCrawl({
url,
scan: true,
userId,
subdomains: !!subdomains,
tld: !!tld,
scan: true,
});
});

Expand Down Expand Up @@ -54,7 +54,7 @@ export const crawlHttpStream = (
crawlTrackingEmitter.once(
`crawl-complete-${getKey(domain, undefined, userId)}`,
() => {
// send extra item for trailing comma handler
// send extra item for trailing comma handler non rpc
if (client && client.includes("a11ywatch_cli/")) {
res.raw.write(
`${JSON.stringify({
Expand Down
2 changes: 1 addition & 1 deletion src/proto/calls/core-crawl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ export const crawlStreaming = (
setImmediate(async () => {
await watcherCrawl({
url,
scan: true,
userId,
subdomains: !!subdomains,
tld: !!tld,
scan: true,
});
});

Expand Down
1 change: 0 additions & 1 deletion src/proto/calls/scan-end.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const scanEnd = async (
callback: sendUnaryData<any>
) => {
await crawlTrackerComplete(call.request); // TODO: remove - fully handled via events

crawlTrackingEmitter.emit("crawl-complete", call.request);

callback(null, {});
Expand Down
2 changes: 1 addition & 1 deletion src/queues/crawl/handle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if (
) {
cwLimit = Number(process.env.CRAWL_QUEUE_LIMIT);
} else {
cwLimit = Math.max(3 * (cpus().length || 1), 4);
cwLimit = Math.max(4 * (cpus().length || 1), 4);
}

// crawl queue handler
Expand Down

0 comments on commit 16c663e

Please sign in to comment.