Class: Messaging::Adapters::Postgres::CreateLock
- Inherits:
-
Object
- Object
- Messaging::Adapters::Postgres::CreateLock
- Includes:
- MethodObject
- Defined in:
- lib/messaging/adapters/postgres/create_lock.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/messaging/adapters/postgres/create_lock.rb', line 12 def call connection.execute "SELECT pg_advisory_lock(#{lock_key});" rescue ActiveRecord::QueryCanceled => e Messaging.logger.debug "Locking failed, retrying in 5 seconds" sleep 5 retry end |