Skip to content

Commit

Permalink
Fold schedulingPolicy into cluster.settings
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfernandez committed Aug 20, 2023
1 parent 78842cf commit 4a3b344
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/internal/cluster/primary.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ let ids = 0;
let initialized = false;

// XXX(bnoordhuis) Fold cluster.schedulingPolicy into cluster.settings?
// XXX(alexfernandez) Folded cluster.schedulingPolicy into cluster.settings.
let schedulingPolicy = process.env.NODE_CLUSTER_SCHED_POLICY;
if (schedulingPolicy === 'rr')
schedulingPolicy = SCHED_RR;
Expand All @@ -65,6 +66,7 @@ cluster.setupPrimary = function(options) {
exec: process.argv[1],
execArgv: process.execArgv,
silent: false,
schedulingPolicy: cluster.schedulingPolicy,
...cluster.settings,
...options,
};
Expand All @@ -86,9 +88,10 @@ cluster.setupPrimary = function(options) {
return process.nextTick(setupSettingsNT, settings);

initialized = true;
schedulingPolicy = cluster.schedulingPolicy; // Freeze policy.
schedulingPolicy = settings.schedulingPolicy; // Freeze policy.
assert(schedulingPolicy === SCHED_NONE || schedulingPolicy === SCHED_RR,
`Bad cluster.schedulingPolicy: ${schedulingPolicy}`);
`Bad settings.schedulingPolicy: ${schedulingPolicy}`);
cluster.schedulingPolicy = schedulingPolicy; // Show to the world.

process.nextTick(setupSettingsNT, settings);

Expand Down

0 comments on commit 4a3b344

Please sign in to comment.