Method: MysqlGetlock#locked?

Defined in:
lib/mysql_getlock.rb

#locked?Boolean

Returns:

  • (Boolean)


57
58
59
60
# File 'lib/mysql_getlock.rb', line 57

def locked?
  results = mysql2.query(%Q[select is_used_lock('#{key}')], as: :array)
  !!results.to_a.first.first
end