Skip to content

Commit

Permalink
fix: use same method to read overrides file
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Oct 30, 2023
1 parent 842f67b commit 798e266
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/controllers/cron/update_local_smartapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,9 @@ const updateSmartAPISpecs = async () => {
};

const getAPIOverrides = async data => {
const overridesPath = path.resolve(__dirname, "../../config/smartapi_overrides.json");
let overrides;
try {
overrides = JSON.parse(await readFile(overridesPath));
overrides = require("../../config/smartapi_overrides.json");
} catch (error) {
debug(`ERROR getting API Overrides file because ${error}`);
return;
Expand Down Expand Up @@ -357,10 +356,9 @@ module.exports = () => {
});

if (api_override) {
const overridesPath = path.resolve(__dirname, "../../config/smartapi_overrides.json");
let overrides;
try {
overrides = JSON.parse(fs.readFileSync(overridesPath));
overrides = require("../../config/smartapi_overrides.json");
} catch (error) {
debug(`ERROR getting API Overrides file because ${error}`);
return;
Expand Down

0 comments on commit 798e266

Please sign in to comment.