From 50ef9f499abb3beb05b0e7b8ffb08a8f323ab765 Mon Sep 17 00:00:00 2001 From: Jonathan Cammisuli Date: Wed, 28 Aug 2024 08:44:41 -0400 Subject: [PATCH] fix(core): change remoteCache to be a function call --- packages/nx/src/nx-cloud/update-manager.ts | 2 +- packages/nx/src/tasks-runner/cache.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nx/src/nx-cloud/update-manager.ts b/packages/nx/src/nx-cloud/update-manager.ts index e81c3c7c70295..ca8b01e030adb 100644 --- a/packages/nx/src/nx-cloud/update-manager.ts +++ b/packages/nx/src/nx-cloud/update-manager.ts @@ -56,7 +56,7 @@ export interface NxCloudClient { configureLightClientRequire: () => (paths: string[]) => void; commands: Record Promise>; nxCloudTasksRunner: TasksRunner; - remoteCache: RemoteCacheV2; + getRemoteCache: () => RemoteCacheV2; } export async function verifyOrUpdateNxCloudClient( options: CloudTaskRunnerOptions diff --git a/packages/nx/src/tasks-runner/cache.ts b/packages/nx/src/tasks-runner/cache.ts index dc05a3a9fee84..b5623b4a16c41 100644 --- a/packages/nx/src/tasks-runner/cache.ts +++ b/packages/nx/src/tasks-runner/cache.ts @@ -119,8 +119,8 @@ export class DbCache { if (isNxCloudUsed(nxJson)) { const options = getCloudOptions(); const { nxCloudClient } = await verifyOrUpdateNxCloudClient(options); - if (nxCloudClient.remoteCache) { - return nxCloudClient.remoteCache; + if (nxCloudClient.getRemoteCache) { + return nxCloudClient.getRemoteCache(); } else { // old nx cloud instance return await RemoteCacheV2.fromCacheV1(this.options.nxCloudRemoteCache);