From 247a9408445f9f79d1451eeb96d3ca0813c135cd Mon Sep 17 00:00:00 2001 From: khalilou88 <32600911+khalilou88@users.noreply.github.com> Date: Tue, 8 Oct 2024 23:56:55 +0200 Subject: [PATCH] fix: add cacheDirectory to clearCacheById function --- packages/nx-maven/src/graph/graph-utils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nx-maven/src/graph/graph-utils.ts b/packages/nx-maven/src/graph/graph-utils.ts index d05762cc7..36f67c97d 100644 --- a/packages/nx-maven/src/graph/graph-utils.ts +++ b/packages/nx-maven/src/graph/graph-utils.ts @@ -51,9 +51,10 @@ export interface WorkspaceDataType { } const cacheId = 'workspace-data.json'; +const cacheDirectory = path.join(workspaceDataDirectory, 'nx-maven'); const cache = flatCache.create({ cacheId: cacheId, - cacheDir: path.join(workspaceDataDirectory, 'nx-maven'), + cacheDir: cacheDirectory, ttl: 60 * 60 * 1000, }); const key = 'workspace-data'; @@ -103,7 +104,7 @@ export function getCachedWorkspaceData() { } export function removeWorkspaceDataCache() { - flatCache.clearCacheById(cacheId); + flatCache.clearCacheById(cacheId, cacheDirectory); } export function addProjects(