diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/boot/master.ts | 2 | ||||
| -rw-r--r-- | src/config/types.ts | 3 | ||||
| -rw-r--r-- | src/queue/index.ts | 4 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/boot/master.ts b/src/boot/master.ts index b698548d47..381c4bc4ca 100644 --- a/src/boot/master.ts +++ b/src/boot/master.ts @@ -159,7 +159,7 @@ async function init(): Promise<Config> { return config; } -async function spawnWorkers(limit: number = Infinity) { +async function spawnWorkers(limit: number = 1) { const workers = Math.min(limit, os.cpus().length); bootLogger.info(`Starting ${workers} worker${workers === 1 ? '' : 's'}...`); await Promise.all([...Array(workers)].map(spawnWorker)); diff --git a/src/config/types.ts b/src/config/types.ts index 9ecf495c42..18382d7435 100644 --- a/src/config/types.ts +++ b/src/config/types.ts @@ -42,6 +42,9 @@ export type Source = { id: string; outgoingAddressFamily?: 'ipv4' | 'ipv6' | 'dual'; + + deliverJobConcurrency?: number; + inboxJobConcurrency?: number; }; /** diff --git a/src/queue/index.ts b/src/queue/index.ts index a7e9b9814f..0b20017291 100644 --- a/src/queue/index.ts +++ b/src/queue/index.ts @@ -203,8 +203,8 @@ export function createCleanRemoteFilesJob() { export default function() { if (!program.onlyServer) { - deliverQueue.process(128, processDeliver); - inboxQueue.process(128, processInbox); + deliverQueue.process(config.deliverJobConcurrency || 128, processDeliver); + inboxQueue.process(config.inboxJobConcurrency || 16, processInbox); processDb(dbQueue); procesObjectStorage(objectStorageQueue); } |