-
Notifications
You must be signed in to change notification settings - Fork 29
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
Connection not ready issue #28
Comments
Note this does work:
|
Hey @theogravity give it a shot with the latest version of the code when you get a chance, I think I fixed a bug relating to the connection buffering which should resolve this issue. |
still no go on ver 0.2.16 doing
|
I ran into this today too. I want bufferBeforeError to be 0 so operations fail immediately when memcached becomes unavailable, but that also means the initial calls fail on application startup because the memcached connection isn't ready when I fire off my initial get() requests. I dug through the code and noticed that there is a ready() function in the client. What I do is on app startup is set an interval to check if the memcached connection is ready() before proceeding. If after a certain number of seconds the connection isn't ready, I load the app anyway. The goal is to make memcached optional and to fail fast when it's not available. Perhaps you could add an autoConnect option and when set to false, connect() isn't called on instantiation. Then connect() could be made public and could take a callback and return a Promise like many of the other functions do. I think that would make sense to me (I'm fine with how I'm doing this now though). If there's a better way to do what I want to do, please let me know! |
I'm trying to check if the memcached server is up before I run my app (using
bufferBeforeError
). I have the following code:But I keep getting the following thrown/rejected:
My memcached server is running; when I switch to an older branch of my code using the
memcached
module, things workThe text was updated successfully, but these errors were encountered: