From d68379718571c16f95465598e18bcaa7d6722898 Mon Sep 17 00:00:00 2001 From: Ryan Pandya Date: Fri, 31 Jan 2025 18:25:40 -0800 Subject: [PATCH] move pg_dump elsewhere so it doesn't run during the Docker build --- apps/web/app/api/db/download/route.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/web/app/api/db/download/route.ts b/apps/web/app/api/db/download/route.ts index 4192b05..893c11b 100644 --- a/apps/web/app/api/db/download/route.ts +++ b/apps/web/app/api/db/download/route.ts @@ -8,12 +8,11 @@ import { pgDump } from 'pg-dump-restore'; const dbPath = path.join(serverConfig.dataDir, `lifetracker-${new Date().getTime()}.sql`); -const returnVal = (await pgDump(getConnectionDetails(), { - filePath: dbPath, -})); - export async function GET(req: NextRequest) { try { + console.log((await pgDump(getConnectionDetails(), { + filePath: dbPath, + })).stdout); // Read the production database file const dbFile = fs.readFileSync(dbPath); return new NextResponse(dbFile, {