Skip to content

Commit

Permalink
fix(core): allow daemon to disable glob cache (#10031)
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Apr 27, 2022
1 parent e3817ef commit fa81e3b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/nx/src/config/workspaces.ts
Expand Up @@ -505,7 +505,11 @@ export function globForProjectFiles(
) {
// Deal w/ Caching
const cacheKey = [root, ...(nxJson?.plugins || [])].join(',');
if (projectGlobCache && cacheKey === projectGlobCacheKey)
if (
process.env.NX_PROJECT_GLOB_CACHE !== 'false' &&
projectGlobCache &&
cacheKey === projectGlobCacheKey
)
return projectGlobCache;
projectGlobCacheKey = cacheKey;

Expand Down
7 changes: 7 additions & 0 deletions packages/nx/src/daemon/client/client.ts
Expand Up @@ -17,6 +17,11 @@ import {
} from '../tmp-dir';
import { ProjectGraph } from '../../config/project-graph';

const DAEMON_ENV_SETTINGS = {
...process.env,
NX_PROJECT_GLOB_CACHE: 'false',
};

export async function startInBackground(): Promise<ChildProcess['pid']> {
await safelyCleanUpExistingProcess();
ensureDirSync(DAEMON_DIR_FOR_CURRENT_WORKSPACE);
Expand All @@ -33,6 +38,7 @@ export async function startInBackground(): Promise<ChildProcess['pid']> {
detached: true,
windowsHide: true,
shell: false,
env: DAEMON_ENV_SETTINGS,
}
);
backgroundProcess.unref();
Expand Down Expand Up @@ -92,6 +98,7 @@ export function startInCurrentProcess(): void {
spawnSync(process.execPath, [join(__dirname, '../server/start.js')], {
cwd: workspaceRoot,
stdio: 'inherit',
env: DAEMON_ENV_SETTINGS,
});
}

Expand Down

1 comment on commit fa81e3b

@vercel
Copy link

@vercel vercel bot commented on fa81e3b Apr 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-five.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx.dev
nx-dev-nrwl.vercel.app

Please sign in to comment.