Skip to content

Commit

Permalink
fix(core): temp workaround to deal with daemon start during workspace…
Browse files Browse the repository at this point in the history
… creation
  • Loading branch information
vsavkin committed Sep 19, 2022
1 parent d9afcac commit 8e8b175
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
5 changes: 5 additions & 0 deletions packages/create-nx-workspace/bin/create-nx-workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ async function main(parsedArgs: yargs.Arguments<Arguments>) {
}

await recordWorkspaceCreationStats(nxCloud);

// vsavkin: temporary workaround
try {
await execAndWait('npx nx reset', directory);
} catch (e) {}
}

async function getConfiguration(
Expand Down
30 changes: 15 additions & 15 deletions packages/nx/bin/compute-project-graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ import { daemonClient } from '../src/daemon/client/client';

(async () => {
try {
if (fileExists(join(workspaceRoot, 'nx.json'))) {
try {
await daemonClient.stop();
} catch (e) {}
const b = new Date();
await buildProjectGraphWithoutDaemon();
const a = new Date();
if (process.env.NX_VERBOSE_LOGGING === 'true') {
console.log(
`Nx project graph has been precomputed in ${
a.getTime() - b.getTime()
}ms`
);
}
}
// if (fileExists(join(workspaceRoot, 'nx.json'))) {
// try {
// await daemonClient.stop();
// } catch (e) {}
// const b = new Date();
// await buildProjectGraphWithoutDaemon();
// const a = new Date();
// if (process.env.NX_VERBOSE_LOGGING === 'true') {
// console.log(
// `Nx project graph has been precomputed in ${
// a.getTime() - b.getTime()
// }ms`
// );
// }
// }
} catch (e) {
// Do not error since this runs in a postinstall
}
Expand Down

0 comments on commit 8e8b175

Please sign in to comment.