push
This commit is contained in:
@@ -7,7 +7,6 @@ import cors from "cors";
|
||||
import { getScrapeQueue } from "./services/queue-service";
|
||||
import { v0Router } from "./routes/v0";
|
||||
import { initSDK } from "@hyperdx/node-opentelemetry";
|
||||
import cluster from "cluster";
|
||||
import os from "os";
|
||||
import { Logger } from "./lib/logger";
|
||||
import { adminRouter } from "./routes/admin";
|
||||
@@ -37,22 +36,6 @@ const cacheable = new CacheableLookup({
|
||||
cacheable.install(http.globalAgent);
|
||||
cacheable.install(https.globalAgent)
|
||||
|
||||
if (cluster.isMaster) {
|
||||
Logger.info(`Master ${process.pid} is running`);
|
||||
|
||||
// Fork workers.
|
||||
for (let i = 0; i < numCPUs; i++) {
|
||||
cluster.fork();
|
||||
}
|
||||
|
||||
cluster.on("exit", (worker, code, signal) => {
|
||||
if (code !== null) {
|
||||
Logger.info(`Worker ${worker.process.pid} exited`);
|
||||
Logger.info("Starting a new worker");
|
||||
cluster.fork();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
const ws = expressWs(express());
|
||||
const app = ws.app;
|
||||
|
||||
@@ -226,9 +209,6 @@ if (cluster.isMaster) {
|
||||
});
|
||||
|
||||
Logger.info(`Worker ${process.pid} started`);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// const sq = getScrapeQueue();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user