Skip to content

Commit

Permalink
Implement dynamic pageLoadTimeout variable as param for generator class
Browse files Browse the repository at this point in the history
  • Loading branch information
saiat3 committed Jun 18, 2019
1 parent bdd7c77 commit bfa907f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Generator {
this.folderName = params.folderName;
this.sitesFolder = `${this.RUNTIME}${websitesFolderName}${this.folderName ? this.folderName : this.websiteName}`;
this.authParams = params.authParams;
this.pageLoadTimeout = params.pageLoadTimeout || 30000;

//Event listeners
this.onUrlFind = params.onUrlFind;
Expand Down Expand Up @@ -172,7 +173,7 @@ class Generator {
password: this.authParams.HTTP_BASIC_AUTH_PASSWORD
});
}
await page.goto(url, {timeout: 30000});
await page.goto(url, {timeout: this.pageLoadTimeout});

let image = imageName === '' ? "_" + md5(imageName) : imageName;
let folderPath = `${imageFolder}`;
Expand Down Expand Up @@ -383,8 +384,7 @@ class Generator {

if (url.indexOf("//") > -1) {
hostname = url.split('/')[2];
}
else {
} else {
hostname = url.split('/')[0];
}

Expand Down

0 comments on commit bfa907f

Please sign in to comment.