Skip to content

Commit a0dc0f1

Browse files
authored
fix(core): change remoteCache to getRemoteCache (#27673)
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> Calling remoteCache directly for the Nx cloud package causes issues with how nx cloud deals with imports ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> `remoteCache` is now a function call so that the nx cloud package functions properly ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
1 parent 56311ae commit a0dc0f1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/nx/src/nx-cloud/update-manager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export interface NxCloudClient {
5656
configureLightClientRequire: () => (paths: string[]) => void;
5757
commands: Record<string, () => Promise<void>>;
5858
nxCloudTasksRunner: TasksRunner<CloudTaskRunnerOptions>;
59-
remoteCache: RemoteCacheV2;
59+
getRemoteCache: () => RemoteCacheV2;
6060
}
6161
export async function verifyOrUpdateNxCloudClient(
6262
options: CloudTaskRunnerOptions

packages/nx/src/tasks-runner/cache.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ export class DbCache {
119119
if (isNxCloudUsed(nxJson)) {
120120
const options = getCloudOptions();
121121
const { nxCloudClient } = await verifyOrUpdateNxCloudClient(options);
122-
if (nxCloudClient.remoteCache) {
123-
return nxCloudClient.remoteCache;
122+
if (nxCloudClient.getRemoteCache) {
123+
return nxCloudClient.getRemoteCache();
124124
} else {
125125
// old nx cloud instance
126126
return await RemoteCacheV2.fromCacheV1(this.options.nxCloudRemoteCache);

0 commit comments

Comments
 (0)