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

jobs returned by Job.get() don't fire events #91

Closed
RandomEtc opened this issue Dec 31, 2011 · 2 comments
Closed

jobs returned by Job.get() don't fire events #91

RandomEtc opened this issue Dec 31, 2011 · 2 comments

Comments

@RandomEtc
Copy link

This is similar to #68 but not quite the same. We use Job.get to avoid creating duplicate jobs, but when we add on('complete',...) handler for the Job instance returned by Job.get then nothing fires. This is because the redis pubsub events are wired into job's EventEmitter using events.add(job) which is only called after a successful job.save.

I'm not sure if we should call job.save ourselves on the returned job from Job.get or if we should call events.add(job) or if Job.get should be doing that - thoughts?

This was referenced Dec 31, 2011
@scttnlsn
Copy link
Contributor

scttnlsn commented Oct 5, 2012

@RandomEtc Have you already implemented anything for this issue? It would be nice to have a subscribe method on a job that calls events.add(this). After saving a job it auto-subscribes itself to any events (as it does now) but we'd also have the option of calling subscribe after retrieving a job via Job.get to start receiving updates.

@RandomEtc
Copy link
Author

Closing since it's fixed in #139

Thanks for tackling this - we never got around to it!

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

No branches or pull requests

2 participants