Page MenuHomePhabricator

D9301.diff
No OneTemporary

D9301.diff

diff --git a/keyserver/src/keyserver.js b/keyserver/src/keyserver.js
--- a/keyserver/src/keyserver.js
+++ b/keyserver/src/keyserver.js
@@ -60,6 +60,8 @@
? undefined
: { maxAge: '1y', immutable: true };
+ const isCPUProfilingEnabled = process.env.KEYSERVER_CPU_PROFILING_ENABLED;
+
if (cluster.isMaster) {
const didMigrationsSucceed: boolean = await migrate();
if (!didMigrationsSucceed) {
@@ -103,12 +105,16 @@
}
}
- const cpuCount = os.cpus().length;
- for (let i = 0; i < cpuCount; i++) {
- cluster.fork();
+ if (!isCPUProfilingEnabled) {
+ const cpuCount = os.cpus().length;
+ for (let i = 0; i < cpuCount; i++) {
+ cluster.fork();
+ }
+ cluster.on('exit', () => cluster.fork());
}
- cluster.on('exit', () => cluster.fork());
- } else {
+ }
+
+ if (!cluster.isMaster || isCPUProfilingEnabled) {
const server = express();
expressWs(server);
server.use(express.json({ limit: '250mb' }));

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 3, 12:44 AM (22 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2609507
Default Alt Text
D9301.diff (1001 B)

Event Timeline