-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
My app experienced an explosion of redis connections after I started using this gem, which is a problem because the redis service I use has a connection cap. It seems that this gem never disconnects redis connections, nor does it use a redis connection pool. Redis connections are left open until their ruby objects are eventually garbage collected.
The easiest solution for me was to shim some disconnect code into the "unlock" method, since I was overriding the suo gem adapter anyway so I could specify a port and password (see #3).
In this case the relevant code is:
module SuoLockingAdapterExtension
def unlock
super
lock_manager.client.close
end
end
ActiveJob::Locking::Adapters::SuoRedis.send :prepend, SuoLockingAdapterExtension
Not sure how you want to incorporate that into the gem, but the line of code would presumably be needed by all redis services. I just happen to be using Suo.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels