Use "writeFileSync" instead of "writeFile"

Reviewed By: cpojer

Differential Revision: D7110494

fbshipit-source-id: 3024227431317a446ec23d2c78cde8a66c49d41f
This commit is contained in:
Miguel Jimenez Esun 2018-03-01 05:30:32 -08:00 committed by Facebook Github Bot
parent da45d64c76
commit 123f1cfd42
1 changed files with 2 additions and 8 deletions

View File

@ -42,14 +42,8 @@ class FileStore {
}
}
set(key: Buffer, value: TransformedCode): Promise<void> {
return new Promise((resolve, reject) => {
const data = serializer.serialize(value);
fs.writeFile(this._getFilePath(key), data, err => {
err ? reject(err) : resolve();
});
});
set(key: Buffer, value: TransformedCode): void {
fs.writeFileSync(this._getFilePath(key), serializer.serialize(value));
}
_getFilePath(key: Buffer): string {