feat(cache): implement a simple caching mechanism with TTL and prefix invalidation
refactor(expenses): integrate caching for periodic expenses and related operations refactor(quotes): add caching for quotes retrieval and history endpoints
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { Context } from "hono";
|
||||
import { prisma } from "../../../lib/prisma";
|
||||
import { cache } from "../../../lib/cache";
|
||||
import { logger } from "../../../lib/logger";
|
||||
import { PaymentStatus } from "../../../generated/prisma/client";
|
||||
|
||||
@@ -113,6 +114,8 @@ export async function importExpensesHandler(c: Context) {
|
||||
}
|
||||
}
|
||||
|
||||
cache.invalidateByPrefix("expenses:");
|
||||
|
||||
return c.json({
|
||||
imported,
|
||||
skipped,
|
||||
|
||||
Reference in New Issue
Block a user