Skip to content

Commit

Permalink
feat: added analyser timeout configuration (env var) Fixes #360
Browse files Browse the repository at this point in the history
  • Loading branch information
danielweck committed Jul 11, 2023
1 parent ad64916 commit 5682175
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/ace-axe-runner-electron/src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,21 @@ function loadUrl(browserWindow) {
return;
}

const MILLISECONDS_TIMEOUT_INITIAL = 10000; // 10s max to load the window's web contents
const MILLISECONDS_TIMEOUT_EXTENSION = 480000; // 480s (8mn) max to load + execute Axe checkers
let _MILLISECONDS_TIMEOUT_INITIAL = 0;
try {
_MILLISECONDS_TIMEOUT_INITIAL = process.env.ACE_TIMEOUT_INITIAL ? parseInt(process.env.ACE_TIMEOUT_INITIAL, 10) : 0;
} catch(_e) {
// ignore
}
let _MILLISECONDS_TIMEOUT_EXTENSION = 0;
try {
_MILLISECONDS_TIMEOUT_EXTENSION = process.env.ACE_TIMEOUT_EXTENSION ? parseInt(process.env.ACE_TIMEOUT_EXTENSION, 10) : 0;
} catch(_e) {
// ignore
}
const MILLISECONDS_TIMEOUT_INITIAL = _MILLISECONDS_TIMEOUT_INITIAL || 10000; // 10s max to load the window's web contents
const MILLISECONDS_TIMEOUT_EXTENSION = _MILLISECONDS_TIMEOUT_EXTENSION || 480000; // 480s (8mn) max to load + execute Axe checkers

const timeoutFunc = () => {
if (browserWindow.ace__replySent) {
browserWindow.ace__timeout = undefined;
Expand Down

0 comments on commit 5682175

Please sign in to comment.