Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • H headless-chrome-crawler
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 29
    • Issues 29
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • yujiosaka
  • headless-chrome-crawler
  • Merge requests
  • !45
An error occurred while fetching the assigned milestone of the selected merge_request.

Fix a bug of opening too many tabs when error occured

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged yujiosaka requested to merge fix_too_many_tabs into master 7 years ago
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 1
  • Fix a bug of opening too many tabs at the same time
Compare
  • master (base)

and
  • latest version
    1e312172
    1 commit, 2 years ago

1 file
+ 18
- 16

    Preferences

    File browser
    Compare changes
lib/hccrawler.js
+ 18
- 16
  • View file @ 1e312172

  • Edit in single-file editor

  • Open in Web IDE


@@ -265,25 +265,27 @@ class HCCrawler {
links: res.links,
options,
}))
.then(() => void debugRequest(`End requesting ${this._options.url}`))
.then(() => crawler.close())
.then(() => void this._checkRequestCount())
.then(() => delay(options.delay))
.then(() => this._followLinks(res.links, options, depth))
))
))
.then(() => void debugRequest(`End requesting ${this._options.url}`))
.then(() => delay(options.delay))
.then(() => void this._checkRequestCount());
})
.catch(error => {
if (retryCount >= options.retryCount) throw new Error(`Retry give-up for requesting ${options.url}!`, error);
debugRequest(`Retry requesting ${options.url} ${retryCount + 1} times`);
return delay(options.retryDelay)
.then(() => this._removeExists(options))
.then(() => this._request(options, depth, retryCount + 1));
})
.catch(error => {
debugRequest(`Retry give-up for requesting ${options.url} after ${retryCount} tries`);
const onError = options.onError || noop;
return Promise.resolve(onError(error));
.catch(error => {
if (retryCount >= options.retryCount) throw new Error(`Retry give-up for requesting ${options.url}!`, error);
debugRequest(`Retry requesting ${options.url} ${retryCount + 1} times`);
return crawler.close()
.then(() => delay(options.retryDelay))
.then(() => this._removeExists(options))
.then(() => this._request(options, depth, retryCount + 1));
})
.catch(error => {
debugRequest(`Retry give-up for requesting ${options.url} after ${retryCount} tries`);
const onError = options.onError || noop;
return crawler.close()
.then(() => Promise.resolve(onError(error)));
})
));
});
}
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
3
3 participants
XhmikosR
Mark Otto
Administrator
Reference:
Source branch: fix_too_many_tabs

Menu

Explore Projects Groups Snippets