Skip to content

Commit

Permalink
bump the timeout and make sure we're not done loading
Browse files Browse the repository at this point in the history
  • Loading branch information
futurepaul authored and TonyGiorgio committed Apr 19, 2024
1 parent 7d68c37 commit 4524946
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/state/megaStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,20 +204,23 @@ export const Provider: ParentComponent = (props) => {
await setSettings(settings);
}

// 60 seconds to load or we bail
// 90 seconds to load or we bail
const start = Date.now();
const MAX_LOAD_TIME = 60000;
const MAX_LOAD_TIME = 90000;
const interval = setInterval(() => {
console.log("Running setup", Date.now() - start);
if (Date.now() - start > MAX_LOAD_TIME) {
clearInterval(interval);
// Have to set state error here because throwing doesn't work if WASM panics
setState({
setup_error: new Error(
"Load timed out, please try again"
)
});
return;
// Only want to do this if we're really not done loading
if (state.load_stage !== "done") {
// Have to set state error here because throwing doesn't work if WASM panics
setState({
setup_error: new Error(
"Load timed out, please try again"
)
});
return;
}
}
}, 1000);

Expand Down

0 comments on commit 4524946

Please sign in to comment.