File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,8 @@ class Worker extends BaseRunner_1.BaseRunner {
132132 const totalWorkers = await this . client . sMembers ( this . key ( 'workers' ) ) ;
133133 const totalWorkersCount = totalWorkers . length ;
134134 console . log ( "[ci-queue] Total workers count: " , totalWorkersCount ) ;
135- const stayRunningThreshold = Math . min ( Math . floor ( totalWorkersCount * 0.6 ) , 1 ) ;
135+ // Only keep 20% of workers running
136+ const stayRunningThreshold = Math . max ( Math . floor ( totalWorkersCount * 0.2 ) , 1 ) ;
136137 console . log ( "[ci-queue] Threshold for early shutdown: " , stayRunningThreshold ) ;
137138 const parallelJob = parseInt ( this . config . workerId , 10 ) ;
138139 const shouldShutdownEarly = parallelJob > stayRunningThreshold ;
Original file line number Diff line number Diff line change @@ -192,7 +192,8 @@ export class Worker extends BaseRunner {
192192 const totalWorkersCount = totalWorkers . length ;
193193 console . log ( "[ci-queue] Total workers count: " , totalWorkersCount ) ;
194194
195- const stayRunningThreshold = Math . min ( Math . floor ( totalWorkersCount * 0.4 ) , 1 ) ;
195+ // Only keep 20% of workers running
196+ const stayRunningThreshold = Math . max ( Math . floor ( totalWorkersCount * 0.2 ) , 1 ) ;
196197 console . log ( "[ci-queue] Threshold for early shutdown: " , stayRunningThreshold ) ;
197198
198199 const parallelJob = parseInt ( this . config . workerId , 10 ) ;
You can’t perform that action at this time.
0 commit comments