mirror of
https://github.com/neocities/neocities.git
synced 2025-08-04 16:51:36 +02:00
use redis connection pool for cache purge
This commit is contained in:
parent
adaf581731
commit
c0bea57468
2 changed files with 6 additions and 2 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue