Skip to content

Commit

Permalink
bugfix/2017.03.30_fix-disconnect-issue (#5)
Browse files Browse the repository at this point in the history
* call stop on eredis client when recycling a worker

* increase default recycle count to 50k from 10k

* update version to 0.2.1

* update CHANGELOG
  • Loading branch information
ntrepid8 authored Mar 30, 2017
1 parent caaf5bb commit 6cdf4a6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Change Log

## v0.2.1

- Enhancements
- increase default recycle count to 50k from 10k

- Fixes
- call stop on eredis client when recycling a worker

- Contributors
- [ntrepid8](https://github.com/ntrepid8)

## v0.2.0

- Enhancements
Expand Down
5 changes: 4 additions & 1 deletion lib/ex_redis_pool/redis_pool_worker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ defmodule ExRedisPool.RedisPoolWorker do
# recycle_count
# recycle the worker after this many queries
# help the GC on busy systems
recycle_count: 10_000,
recycle_count: 50_000,
]

def start_link(opts \\ []) do
Expand Down Expand Up @@ -150,6 +150,9 @@ defmodule ExRedisPool.RedisPoolWorker do
true ->
# many queries have been run, recycle this worker
Logger.debug("#{__MODULE__} #{state.host}:#{state.port} recycling")
# stop the client
:eredis.stop(state.client)
# shutdown
{:stop, :normal, reply, state}
end
end
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule ExRedisPool.Mixfile do

def project do
[app: :ex_redis_pool,
version: "0.2.0",
version: "0.2.1",
elixir: "~> 1.2",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
Expand Down

0 comments on commit 6cdf4a6

Please sign in to comment.