Merge remote-tracking branch 'origin/mog/no-cluster' into nsc/no-cluster-all
This commit is contained in:
@@ -28,9 +28,6 @@ RUN cd /app/src/lib/go-html-to-md && \
|
|||||||
chmod +x html-to-markdown.so
|
chmod +x html-to-markdown.so
|
||||||
|
|
||||||
FROM base
|
FROM base
|
||||||
RUN apt-get update -qq && \
|
|
||||||
apt-get install --no-install-recommends -y chromium chromium-sandbox && \
|
|
||||||
rm -rf /var/lib/apt/lists /var/cache/apt/archives
|
|
||||||
COPY --from=prod-deps /app/node_modules /app/node_modules
|
COPY --from=prod-deps /app/node_modules /app/node_modules
|
||||||
COPY --from=build /app /app
|
COPY --from=build /app /app
|
||||||
COPY --from=go-base /app/src/lib/go-html-to-md/html-to-markdown.so /app/dist/src/lib/go-html-to-md/html-to-markdown.so
|
COPY --from=go-base /app/src/lib/go-html-to-md/html-to-markdown.so /app/dist/src/lib/go-html-to-md/html-to-markdown.so
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import cors from "cors";
|
|||||||
import { getScrapeQueue } from "./services/queue-service";
|
import { getScrapeQueue } from "./services/queue-service";
|
||||||
import { v0Router } from "./routes/v0";
|
import { v0Router } from "./routes/v0";
|
||||||
import { initSDK } from "@hyperdx/node-opentelemetry";
|
import { initSDK } from "@hyperdx/node-opentelemetry";
|
||||||
import cluster from "cluster";
|
|
||||||
import os from "os";
|
import os from "os";
|
||||||
import { Logger } from "./lib/logger";
|
import { Logger } from "./lib/logger";
|
||||||
import { adminRouter } from "./routes/admin";
|
import { adminRouter } from "./routes/admin";
|
||||||
@@ -37,22 +36,6 @@ const cacheable = new CacheableLookup({
|
|||||||
cacheable.install(http.globalAgent);
|
cacheable.install(http.globalAgent);
|
||||||
cacheable.install(https.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 ws = expressWs(express());
|
||||||
const app = ws.app;
|
const app = ws.app;
|
||||||
|
|
||||||
@@ -226,9 +209,6 @@ if (cluster.isMaster) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Logger.info(`Worker ${process.pid} started`);
|
Logger.info(`Worker ${process.pid} started`);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// const sq = getScrapeQueue();
|
// const sq = getScrapeQueue();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user