chore: format

This commit is contained in:
2025-10-10 16:43:21 +02:00
parent f0aabd63b6
commit 75c29e0ba4
551 changed files with 433948 additions and 94145 deletions

View File

@@ -1,44 +1,44 @@
export type * from "./app"
export type * from "../prisma/client"
export type * from "./types"
export type * from "./app";
export type * from "../prisma/client";
export type * from "./types";
import { app } from "./app"
import { initializeCronJobs } from "./cron/cron"
import { prisma } from "./utils/prisma"
import { app } from "./app";
import { initializeCronJobs } from "./cron/cron";
import { prisma } from "./utils/prisma";
const cronController = initializeCronJobs()
const cronController = initializeCronJobs();
const PORT = process.env.PORT || 5000
const PORT = process.env.PORT || 5000;
prisma.$connect().then(async () => {
console.log("Connected to database")
console.log("Connected to database");
// For backwards compatibility, set all messages that have campaign status === "CANCELLED" to "CANCELLED"
await prisma.message.updateMany({
where: {
Campaign: {
status: "CANCELLED",
},
status: {
in: ["QUEUED", "PENDING", "RETRYING"],
},
},
data: {
status: "CANCELLED",
},
})
// For backwards compatibility, set all messages that have campaign status === "CANCELLED" to "CANCELLED"
await prisma.message.updateMany({
where: {
Campaign: {
status: "CANCELLED",
},
status: {
in: ["QUEUED", "PENDING", "RETRYING"],
},
},
data: {
status: "CANCELLED",
},
});
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`)
})
})
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
});
// Handle graceful shutdown
const shutdown = () => {
console.log("Shutting down cron jobs...")
cronController.stop()
process.exit(0)
}
console.log("Shutting down cron jobs...");
cronController.stop();
process.exit(0);
};
process.on("SIGINT", shutdown)
process.on("SIGTERM", shutdown)
process.on("SIGINT", shutdown);
process.on("SIGTERM", shutdown);