Unverified Commit 0ff87388 authored by Pavel Ševčík's avatar Pavel Ševčík
Browse files

retry loading config after failure

parent 5784b097
......@@ -9,7 +9,7 @@ import { pipe } from "fp-ts/lib/pipeable";
import { version } from "../../package.json";
import { DOJO_ENV_PATH, EXPLORER_CONFIG_PATH, HOUR, NODE_CONFIG_PATH } from "../const";
import { DOJO_ENV_PATH, EXPLORER_CONFIG_PATH, HOUR, MINUTE, NODE_CONFIG_PATH } from "../const";
import { execAndGetResult } from "../services/docker";
import { getValue } from "../lib/read-config";
import { logError } from "../services/logger";
......@@ -102,6 +102,12 @@ const loadConfig: TE.TaskEither<Error, ConfigWithExplorer> = pipe(
// Function to load and assign config
const loadConfigAndAssign = () =>
loadConfig().then((loadedConfig) => {
// If loading config fails, try again after a minute
if (E.isLeft(loadedConfig)) {
setTimeout(() => {
loadConfigAndAssign();
}, MINUTE);
}
configWithExplorerStore = loadedConfig;
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment