Merge remote-tracking branch 'origin/mog/no-cluster' into nsc/no-cluster-all

This commit is contained in:
Nicolas 2024-10-09 19:26:11 -03:00
commit 7847404e1f
2 changed files with 149 additions and 172 deletions

View File

@ -28,9 +28,6 @@ RUN cd /app/src/lib/go-html-to-md && \
chmod +x html-to-markdown.so
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=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

View File

@ -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();