From e8e7c116d192095bd2e0d61a196538fd5a5d9039 Mon Sep 17 00:00:00 2001 From: Eric Allam Date: Thu, 9 Nov 2023 21:52:48 +0000 Subject: [PATCH] =?UTF-8?q?Remove=20the=20pg=20listen=20code=20to=20see=20?= =?UTF-8?q?if=20it=E2=80=99s=20causing=20DB=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/webapp/app/platform/zodWorker.server.ts | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/apps/webapp/app/platform/zodWorker.server.ts b/apps/webapp/app/platform/zodWorker.server.ts index bdf356b85..29fd17d89 100644 --- a/apps/webapp/app/platform/zodWorker.server.ts +++ b/apps/webapp/app/platform/zodWorker.server.ts @@ -14,7 +14,6 @@ import { run as graphileRun, parseCronItems } from "graphile-worker"; import omit from "lodash.omit"; import { z } from "zod"; import { PrismaClient, PrismaClientOrTransaction } from "~/db.server"; -import { PgListenService } from "~/services/db/pgListen.server"; import { workerLogger as logger } from "~/services/logger.server"; export interface MessageCatalogSchema { @@ -167,21 +166,6 @@ export class ZodWorker { this.#runner?.events.on("pool:listen:success", async ({ workerPool, client }) => { this.#logDebug("pool:listen:success"); - - // hijack client instance to listen and react to incoming NOTIFY events - const pgListen = new PgListenService(client, this.#name, logger); - - await pgListen.on("trigger:graphile:migrate", async ({ latestMigration }) => { - this.#logDebug("Detected incoming migration", { latestMigration }); - - if (latestMigration > 10) { - // already migrated past v0.14 - nothing to do - return; - } - - // simulate SIGTERM to trigger graceful shutdown - this._handleSignal("SIGTERM"); - }); }); this.#runner?.events.on("pool:listen:error", ({ error }) => {