[MM-39428] Check for EBUSY, add retry logic and logging for writing to config (#1845)

This commit is contained in:
Devin Binnie
2021-11-03 09:26:56 -04:00
committed by GitHub
parent ff8a04245e
commit ba974dbf75
2 changed files with 8 additions and 1 deletions

View File

@@ -179,7 +179,11 @@ export default class Config extends EventEmitter {
try {
this.writeFile(this.configFilePath, this.localConfigData, (error: NodeJS.ErrnoException | null) => {
if (error) {
throw new Error(error.message);
if (error.code === 'EBUSY') {
this.saveLocalConfigData();
} else {
this.emit('error', error);
}
}
this.emit('update', this.combinedData);
this.emit('synchronize');