diff --git a/src/features/grid/api/get-product-rows.ts b/src/features/grid/api/get-product-rows.ts index 262dc99..d4522ba 100644 --- a/src/features/grid/api/get-product-rows.ts +++ b/src/features/grid/api/get-product-rows.ts @@ -16,7 +16,6 @@ import { import { db } from "@/db"; import { sessionSnapshots } from "@/db/schema"; import { eq, desc } from "drizzle-orm"; -import { unstable_cache } from "next/cache"; // ─── Tag de cache par fournisseur ───────────────────────────────────────────── // Permet d'invalider précisément le cache d'un seul fournisseur lors d'une sauvegarde. @@ -315,31 +314,14 @@ async function _fetchAllProductRows(codeFournisseur: string): Promise { const { codeFournisseur } = input; - - // Créer dynamiquement la fonction cachée avec le tag spécifique au fournisseur. - // unstable_cache mémoïse par le tableau de clés [`grid-rows-${codeFournisseur}`]. - const cachedFn = unstable_cache( - async () => _fetchAllProductRows(codeFournisseur), - [`grid-rows-${codeFournisseur}`], - { revalidate: 300, tags: [`grid-rows-${codeFournisseur}`] } - ); - - try { - return await cachedFn(); - } catch (e) { - console.error(`[getProductRows] Cache error for ${codeFournisseur}:`, e); - // Fallback sans cache si unstable_cache échoue - return _fetchAllProductRows(codeFournisseur); - } + + // Appel direct sans l'enveloppe dynamique de unstable_cache qui cause un freeze/timeout + return _fetchAllProductRows(codeFournisseur); }