move pg_dump elsewhere so it doesn't run during the Docker build
This commit is contained in:
parent
38423b88e3
commit
d683797185
@ -8,12 +8,11 @@ import { pgDump } from 'pg-dump-restore';
|
|||||||
|
|
||||||
const dbPath = path.join(serverConfig.dataDir, `lifetracker-${new Date().getTime()}.sql`);
|
const dbPath = path.join(serverConfig.dataDir, `lifetracker-${new Date().getTime()}.sql`);
|
||||||
|
|
||||||
const returnVal = (await pgDump(getConnectionDetails(), {
|
|
||||||
filePath: dbPath,
|
|
||||||
}));
|
|
||||||
|
|
||||||
export async function GET(req: NextRequest) {
|
export async function GET(req: NextRequest) {
|
||||||
try {
|
try {
|
||||||
|
console.log((await pgDump(getConnectionDetails(), {
|
||||||
|
filePath: dbPath,
|
||||||
|
})).stdout);
|
||||||
// Read the production database file
|
// Read the production database file
|
||||||
const dbFile = fs.readFileSync(dbPath);
|
const dbFile = fs.readFileSync(dbPath);
|
||||||
return new NextResponse(dbFile, {
|
return new NextResponse(dbFile, {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user