Page MenuHomePhabricator

D5267.id17247.diff
No OneTemporary

D5267.id17247.diff

diff --git a/keyserver/src/utils/import-json.js b/keyserver/src/utils/import-json.js
--- a/keyserver/src/utils/import-json.js
+++ b/keyserver/src/utils/import-json.js
@@ -1,5 +1,7 @@
// @flow
+import fs from 'fs';
+
type ConfigName = {
+folder: 'secrets' | 'facts',
+name: string,
@@ -42,10 +44,9 @@
}
const path = getPathForConfigName(configName);
try {
- // $FlowFixMe
- const importedJSON = await import(`../../${path}`);
- return importedJSON.default;
- } catch {
+ return JSON.parse(fs.readFileSync(path, 'utf8'));
+ } catch (e) {
+ console.log(`Failed to read JSON from ${path}`, e);
return null;
}
}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 16, 9:26 AM (22 h, 48 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2497128
Default Alt Text
D5267.id17247.diff (653 B)

Event Timeline