Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes an issue where kue-scheduler would throw an error and die when restore:true was set and a downstream error occurred #126

Merged
merged 2 commits into from
Apr 4, 2019

Conversation

ggutenberg
Copy link
Contributor

Fixes #85

The specific error being thrown was TypeError: Cannot read property 'emit' of undefined because this wasn't being bound to done when an error occurred.

Fixes

```
TypeError: Cannot read property 'emit' of undefined
```

When `restore: true` in the `createQueue()` options object.

This was happening when an error was being passed, as the binding wasn't occuring in that instance.  When I was able to output the error that was occurring, it was:

```
Error: All keys in the pipeline should belong to the same slot
    at Pipeline.exec (/data/node_modules/ioredis/lib/pipeline.js:235:21)
    at Pipeline.pipeline.exec (/data/node_modules/ioredis/lib/transaction.js:34:26)
    at Queue.<anonymous> (/data/node_modules/kue-scheduler/index.js:1428:14)
From previous event:
    at new Pipeline (/data/node_modules/ioredis/lib/pipeline.js:30:18)
    at Cluster.redis.multi (/data/node_modules/ioredis/lib/transaction.js:24:20)
    at Queue.<anonymous> (/data/node_modules/kue-scheduler/index.js:1420:32)
    at runCallback (timers.js:800:20)
    at tryOnImmediate (timers.js:762:5)
    at processImmediate [as _immediateCallback] (timers.js:733:5)
```
@lykmapipo lykmapipo merged commit e59bab8 into lykmapipo:master Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants