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
  • Issues
  • #1381
Closed
Open
Issue created Jul 12, 2019 by Administrator@rootContributor

[BUG] moveToCompleted is throwing errors

Created by: akirilyuk

Description

When trying to move all jobs to completed, I get an exception. However I do not understand why this is happening, maybe I am using something wrrong.

Minimal, Working Test code to reproduce the issue.

const Queue = require('bull');

const queue = new Queue('testqueue', 'redis://127.0.0.1:6379');

const testQueue = async () => {
  queue.add({ test: 'data' });
  const jobs = await queue.getJobs();
  jobs.forEach(async job => {
    await job.moveToCompleted('completed', true, true);
  });
};

testQueue();

yields:

(node:4296) UnhandledPromiseRejectionWarning: TypeError: job.queue.client.moveToFinished is not a function at Object.moveToFinished (/Users//node_modules/bull/lib/scripts.js:167:29) at Object.moveToCompleted (/Users/node_modules/bull/lib/scripts.js:194:20) at Job.moveToCompleted (/Users//node_modules/bull/lib/job.js:194:18) at jobs.forEach (/Users//src/queueTest.js:9:15) at Array.forEach () at testQueue (/Users/**/src/queueTest.js:8:8) at process._tickCallback (internal/process/next_tick.js:68:7)

Bull version

3.10.0

Assignee
Assign to
Time tracking