better design on animes and books page

This commit is contained in:
2026-01-05 03:00:58 +01:00
parent a9fc4b0ece
commit 4a711accad
8 changed files with 217 additions and 2 deletions

View File

@@ -165,7 +165,7 @@ const start = async () => {
await refreshPopularBooks();
};
cron.schedule("*/30 * * * *", async () => {
const job = cron.schedule("*/30 * * * *", async () => {
try {
await refreshAll();
console.log("cache refreshed");
@@ -182,6 +182,16 @@ const start = async () => {
console.error("initial refresh failed", e)
);
console.log(`Server running at http://localhost:54322`);
const shutdown = async () => {
job.stop();
await fastify.close();
process.exit(0);
};
process.on("SIGINT", shutdown);
process.on("SIGTERM", shutdown);
} catch (err) {
fastify.log.error(err);
process.exit(1);