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
  • #1344
Closed
Open
Issue created Jun 11, 2019 by Administrator@rootContributor

queue.isReady() throws error if client not initialized

Created by: gabegorelick

Description

If queue._initializing is not set, queue.isReady()will throw a TypeError: Cannot read property 'then' of undefined at https://github.com/OptimalBits/bull/blob/c0ee6be03c6d47d60465d2bae0d2566d5bf0d661/lib/queue.js#L478

_initializing is set when the main Redis client is initialized: https://github.com/OptimalBits/bull/blob/c0ee6be03c6d47d60465d2bae0d2566d5bf0d661/lib/queue.js#L150

Setting skipVersionCheck: true is the only way to trigger this as far as I can tell. Otherwise, getRedisVersion(this.client) will cause _initializing to be set before the Queue constructor returns.

Minimal, Working Test code to reproduce the issue.

const queue = new Queue('foo', {skipVersionCheck: true});
queue.isReady();

Bull version

develop

Additional information

Anything that calls isReady will also throw, e.g. queue.close(), queue.add(), etc.

Assignee
Assign to
Time tracking