From 300d6c740963c9f52a6bd6387b11cb26d5f6f939 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Tue, 20 May 2025 21:55:53 +0800 Subject: [PATCH] Chore: increate fs write worker threshold --- Build/lib/create-file.worker.ts | 9 ++++++++- Build/lib/writing-strategy/base.ts | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Build/lib/create-file.worker.ts b/Build/lib/create-file.worker.ts index 705675f8..1da64328 100644 --- a/Build/lib/create-file.worker.ts +++ b/Build/lib/create-file.worker.ts @@ -5,7 +5,14 @@ import type { Span } from '../trace'; const pool = new Worktank({ name: 'process-phishing-domains', - size: Math.max(2, Math.max(1, ('availableParallelism' in os ? os.availableParallelism() : (os as typeof import('node:os')).cpus().length) - 1)), + size: Math.max( + 1, + ( + 'availableParallelism' in os + ? os.availableParallelism() + : (os as typeof import('node:os')).cpus().length + ) - 1 + ), timeout: 10000, // The maximum number of milliseconds to wait for the result from the worker, if exceeded the worker is terminated and the execution promise rejects warmup: true, autoterminate: 30000, // The interval of milliseconds at which to check if the pool can be automatically terminated, to free up resources, workers will be spawned up again if needed diff --git a/Build/lib/writing-strategy/base.ts b/Build/lib/writing-strategy/base.ts index e27c83ca..98a67f21 100644 --- a/Build/lib/writing-strategy/base.ts +++ b/Build/lib/writing-strategy/base.ts @@ -79,7 +79,7 @@ export abstract class BaseWriteStrategy { return; } - if (this.result.length > 2000) { + if (this.result.length > 3000) { return compareAndWriteFileInWorker( span, this.withPadding(