Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(queue-worker): remove misbehaving stall check

Gergő Móricza6fc5c38618b
diff --git a/apps/api/src/services/queue-worker.ts b/apps/api/src/services/queue-worker.ts
index 11a5a8437..0e00c1a72 100644
--- a/apps/api/src/services/queue-worker.ts
+++ b/apps/api/src/services/queue-worker.ts
@@ -451,37 +451,31 @@ const app = Express();
let currentLiveness: boolean = true;
app.get("/liveness", (req, res) => {
- // stalled check
- if (isWorkerStalled) {
- currentLiveness = false;
- res.status(500).json({ ok: false });
+ if (process.env.USE_DB_AUTHENTICATION === "true") {
+ // networking check for Kubernetes environments
+ const host = process.env.FIRECRAWL_APP_HOST || "firecrawl-app-service";
+ const port = process.env.FIRECRAWL_APP_PORT || "3002";
+ const scheme = process.env.FIRECRAWL_APP_SCHEME || "http";
+
+ robustFetch({
+ url: `${scheme}://${host}:${port}`,
+ method: "GET",
+ mock: null,
+ logger: _logger,
+ abort: AbortSignal.timeout(5000),
+ ignoreResponse: true,
+ })
+ .then(() => {
+ currentLiveness = true;
+ res.status(200).json({ ok: true });
+ }).catch(e => {
+ _logger.error("WORKER NETWORKING CHECK FAILED", { error: e });
+ currentLiveness = false;
+ res.status(500).json({ ok: false });
+ });
} else {
- if (process.env.USE_DB_AUTHENTICATION === "true") {
- // networking check for Kubernetes environments
- const host = process.env.FIRECRAWL_APP_HOST || "firecrawl-app-service";
- const port = process.env.FIRECRAWL_APP_PORT || "3002";
- const scheme = process.env.FIRECRAWL_APP_SCHEME || "http";
-
- robustFetch({
- url: `${scheme}://${host}:${port}`,
- method: "GET",
- mock: null,
- logger: _logger,
- abort: AbortSignal.timeout(5000),
- ignoreResponse: true,
- })
- .then(() => {
- currentLiveness = true;
- res.status(200).json({ ok: true });
- }).catch(e => {
- _logger.error("WORKER NETWORKING CHECK FAILED", { error: e });
- currentLiveness = false;
- res.status(500).json({ ok: false });
- });
- } else {
- currentLiveness = true;
- res.status(200).json({ ok: true });
- }
+ currentLiveness = true;
+ res.status(200).json({ ok: true });
}
});