Class: Messaging::Adapters::Postgres::CreateLock

Inherits:
Object
  • Object
show all
Includes:
MethodObject
Defined in:
lib/messaging/adapters/postgres/create_lock.rb

Instance Method Summary collapse

Instance Method Details

#callObject



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