Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bull
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 175
    • Issues 175
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • 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
  • OptimalBits
  • bull
  • Merge requests
  • !279

Honor start/end range for complete/failed jobs

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/mixmaxhq/slice-range-for-completed-and-failed-jobs into master Apr 02, 2016
  • Overview 4
  • Commits 2
  • Pipelines 0
  • Changes 2

Created by: xdc0

Queue#getJobs accepts a start and end parameters, which allows for retrieving a subset of elements with the lrange and zrange operations. However this can't be done for the smembers operation.

From what I've seen, smembers performs just fine, even when there are thousands of jobs, however, since this retrieves All members in the complete or failed set, then it can choke the process down in

return jobs.then(function(jobIds){
  var jobsFromId = jobIds.map(_this.getJobFromId);
  return Promise.all(jobsFromId);
});

This seems to be alleviated if the jobs are retrieved with batch, instead one by one. I'll open a second PR for this.

Since smembers doesn't accept an offset range, and there's no equivalent that does, we do the slice programatically, so that it behaves consistently with the other job types, where a subset is retrieved by passing start and end

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/mixmaxhq/slice-range-for-completed-and-failed-jobs