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

autoreconnection #25

Closed
kostya opened this issue Jul 13, 2016 · 5 comments
Closed

autoreconnection #25

kostya opened this issue Jul 13, 2016 · 5 comments

Comments

@kostya
Copy link
Collaborator

kostya commented Jul 13, 2016

would be nice if client have auto reconnection mode, because most production redis-servers have option timeout 300, and slow clients often failed with RedisError: Disconnected. And redis-rb have no this problem.

@kostya
Copy link
Collaborator Author

kostya commented Jul 14, 2016

as workaround i using this: https://github.com/kostya/redisoid

@stefanwille
Copy link
Owner

That's good feedback. I'll look into it.

@rwojsznis
Copy link

@stefanwille - just a quick question - will crystal-redis ever support auto-reconnecting or should we rely on third party shards for that? IMHO it would be great if this would be part of it's core (so it's more like redis-rb where it's already there and you don't need wrap everything with something else)

And of course huge thanks for this shard <3

@stefanwille
Copy link
Owner

Hi @emq, this came up 2 or 3 times recently. I guess it is best that I just integrate @kostya's redis-reconnect code for this, if he doesn't mind?

@kostya
Copy link
Collaborator Author

kostya commented Jun 14, 2018

i think i will create pull request, but current code need some refactor

kostya added a commit to kostya/crystal-redis that referenced this issue Jun 14, 2018
* Fixed stefanwille#55, catch all possible socket/connection errors and
  raise Redis::ConnectionError.
* Fixed stefanwille#25, when client execute command and get Redis::ConnectionError,
  it reconnect to redis server and reexecute last command.
* Error connection to redis server now raises Redis::CannotConnectError.
* Redis::DisconnectedError replaced with Redis::ConnectionError.
kostya added a commit to kostya/crystal-redis that referenced this issue Jun 15, 2018
* Fixed stefanwille#55, catch all possible socket/connection errors and
  raise Redis::ConnectionError.
* Fixed stefanwille#25, when client execute command and get Redis::ConnectionError,
  it reconnect to redis server and reexecute last command.
* Error connection to redis server now raises Redis::CannotConnectError.
* Redis::DisconnectedError replaced with Redis::ConnectionError.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants