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

per instance Scripty cache #1

Closed
behrad opened this issue May 2, 2015 · 9 comments
Closed

per instance Scripty cache #1

behrad opened this issue May 2, 2015 · 9 comments

Comments

@behrad
Copy link
Contributor

behrad commented May 2, 2015

using a global cache https://github.com/TheDeveloper/scripty/blob/master/lib/Scripty.js#L16 prevents from closing the redis client and create a new Scripty with a new redis client object.

@TheDeveloper
Copy link
Owner

is your new redis client connected to a different redis server?

@behrad
Copy link
Contributor Author

behrad commented May 2, 2015

no the same server, but different object instance, I'm closing old instance and creating new one :)
this is happening when gracefully shutdown kue: Automattic/kue#578

@behrad
Copy link
Contributor Author

behrad commented May 2, 2015

look at this example code: TheDeveloper/warlock#11 (comment)

@behrad
Copy link
Contributor Author

behrad commented May 2, 2015

generally caching a user/client provided instance object (the redis client) is a bad idea along side Script object.

@TheDeveloper
Copy link
Owner

oh yes I see, the redis client object is being cached along with the script. will merge your PR.

@behrad
Copy link
Contributor Author

behrad commented May 2, 2015

thank you @TheDeveloper

@behrad
Copy link
Contributor Author

behrad commented May 2, 2015

when can I switch to your npm?

@TheDeveloper
Copy link
Owner

just published v0.0.5 :)

warlock will pick up the latest version

@behrad
Copy link
Contributor Author

behrad commented May 2, 2015

👍

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