changes for prod container

This commit is contained in:
Nathan Rashleigh committed 2024-06-30 17:57:54 +10:00
1 parent 4097b05cf9
commit 2cbfb03eb6
14 files changed
+128 -53

No files matched your search

+8
View File
@@ -1,5 +1,7 @@
// index.ts
import "dotenv/config";
import { exec as execCb } from "child_process";
import { promisify } from "util";
import pino from "pino";
import * as Minio from "minio";
import Vision from "@google-cloud/vision";
@@ -302,6 +304,7 @@ async function memeService(baseLog, prisma, meili) {
BigInt.prototype.toJSON = function bigIntStringify() {
return this.toString();
};
var exec = promisify(execCb);
async function main() {
const VISION_CREDENTIALS = (await import(process.env.GOOGLE_APPLICATION_CREDENTIALS, { with: { type: "json" } })).default;
const log = pino({ base: {} });
@@ -331,6 +334,11 @@ async function main() {
1095060717117374687n
// aella memes
];
async function migrateDb() {
const output = await exec("prisma migrate deploy");
log.info(output);
}
await migrateDb();
await Promise.all(CHANNEL_IDS.map((id) => scraper2.processChannel(id)));
}
main().then(() => true).catch((e) => console.error(e));