mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 09:10:35 +08:00
Chore: increate fs write worker threshold
This commit is contained in:
parent
ec28e98c79
commit
300d6c7409
@ -5,7 +5,14 @@ import type { Span } from '../trace';
|
|||||||
|
|
||||||
const pool = new Worktank({
|
const pool = new Worktank({
|
||||||
name: 'process-phishing-domains',
|
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
|
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,
|
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
|
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
|
||||||
|
|||||||
@ -79,7 +79,7 @@ export abstract class BaseWriteStrategy {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.result.length > 2000) {
|
if (this.result.length > 3000) {
|
||||||
return compareAndWriteFileInWorker(
|
return compareAndWriteFileInWorker(
|
||||||
span,
|
span,
|
||||||
this.withPadding(
|
this.withPadding(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user