Skip to content

Instantly share code, notes, and snippets.

View urbanczykd's full-sized avatar

Darek urbanczykd

  • UK London
View GitHub Profile
class DeadlockRetry
DEADLOCK_ERROR_MESSAGES = ["Deadlock found when trying to get lock", "Lock wait timeout exceeded"]
MAXIMUM_RETRIES_ON_DEADLOCK = 10
class << self
def deadlock_free(object, &block)
retry_count = 0
begin