use redis connection pool for cache purge

This commit is contained in:
Kyle Drake 2014-08-15 12:55:10 -07:00
parent adaf581731
commit c0bea57468
2 changed files with 6 additions and 2 deletions

View file

@ -6,7 +6,9 @@ class PurgeCacheWorker
attempt = 0
begin
attempt += 1
$pubsub.publish 'purgecache', payload.to_json
$pubsub_pool.with do |redis|
redis.publish 'purgecache', payload.to_json
end
rescue Redis::BaseConnectionError => error
raise if attempt > 3
puts "pubsub error: #{error}, retrying in 1s"