Fix: added missing await keywords in storeProject (#1731)
Though we don't return any value, we should wait till we've completed the file I/O. This likely caused the flake from #1655. As we didn't await the write, it caused a race condition where we tried to read first. Fixes #1655
This commit is contained in:
parent
eb205e8680
commit
8ca62d6e0c
|
@ -45,18 +45,18 @@ export class DataDirectory implements CacheProvider, ProjectStorageProvider {
|
|||
const fileName = path.join(projectDirectory, name);
|
||||
await fs.writeFile(fileName, data);
|
||||
};
|
||||
writeFile("project.json", stringify(projectToJSON(project)));
|
||||
await writeFile("project.json", stringify(projectToJSON(project)));
|
||||
if (weightedGraph) {
|
||||
writeFile(
|
||||
await writeFile(
|
||||
"weightedGraph.json",
|
||||
stringify(WeightedGraph.toJSON(weightedGraph))
|
||||
);
|
||||
}
|
||||
if (cred) {
|
||||
writeFile("cred.json", stringify(cred.toJSON()));
|
||||
await writeFile("cred.json", stringify(cred.toJSON()));
|
||||
}
|
||||
if (pluginDeclarations) {
|
||||
writeFile(
|
||||
await writeFile(
|
||||
"pluginDeclarations.json",
|
||||
stringify(pluginsToJSON(pluginDeclarations))
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue