Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused method in PgLocks #107

Merged
merged 1 commit into from
Aug 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions lib/good_job/pg_locks.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
module GoodJob
class PgLocks < ActiveRecord::Base
self.table_name = 'pg_locks'.freeze

# https://www.postgresql.org/docs/9.6/view-pg-locks.html
# Advisory locks can be acquired on keys consisting of either a single bigint value or two integer values.
# A bigint key is displayed with its high-order half in the classid column, its low-order half in the objid column, and objsubid equal to 1.
# The original bigint value can be reassembled with the expression (classid::bigint << 32) | objid::bigint.
# Integer keys are displayed with the first key in the classid column, the second key in the objid column, and objsubid equal to 2.
# The actual meaning of the keys is up to the user. Advisory locks are local to each database, so the database column is meaningful for an advisory lock.
def self.advisory_lock_details
connection.select <<~SQL
SELECT *
FROM pg_locks
WHERE
locktype = 'advisory' AND
objsubid = 1
SQL
end
end
end