Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import poolRoutes from "./routes/pool";
import stateRoutes from "./routes/state";
import { pool } from "./config/db";
import { startStorageCleanup, stopStorageCleanup } from "./utils/storage-cleanup";
import { startNonceCleanup, stopNonceCleanup } from "./utils/nonce-cleanup";

dotenv.config();

Expand Down Expand Up @@ -151,6 +152,7 @@ app.get("/health", async (req: Request, res: Response) => {
process.on("SIGTERM", async () => {
logger.info("SIGTERM received, shutting down gracefully");
stopStorageCleanup();
stopNonceCleanup();
try {
await prisma.$disconnect();
logger.info("Database connection closed");
Expand All @@ -172,6 +174,7 @@ async function bootstrap(): Promise<void> {
await connectWithRetry();
startPoolHealthCheck();
startStorageCleanup();
startNonceCleanup();
app.listen(port, () => {
console.log(`⚡️[server]: Server is running at http://localhost:${port}`);
// Update pool metrics periodically so the Prometheus scrape has fresh data
Expand Down
Loading
Loading