From 123f1cfd42a79d18a8a95db640778961e609c330 Mon Sep 17 00:00:00 2001 From: Miguel Jimenez Esun Date: Thu, 1 Mar 2018 05:30:32 -0800 Subject: [PATCH] Use "writeFileSync" instead of "writeFile" Reviewed By: cpojer Differential Revision: D7110494 fbshipit-source-id: 3024227431317a446ec23d2c78cde8a66c49d41f --- packages/metro-cache/src/FileStore.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/metro-cache/src/FileStore.js b/packages/metro-cache/src/FileStore.js index 4e9c3753..85842bc5 100644 --- a/packages/metro-cache/src/FileStore.js +++ b/packages/metro-cache/src/FileStore.js @@ -42,14 +42,8 @@ class FileStore { } } - set(key: Buffer, value: TransformedCode): Promise { - 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 {