debian-mirror-gitlab/lib/gitlab/database/postgres_autovacuum_activity.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
515 B
Ruby
Raw Normal View History

2022-08-13 15:12:31 +05:30
# frozen_string_literal: true
module Gitlab
module Database
class PostgresAutovacuumActivity < SharedModel
self.table_name = 'postgres_autovacuum_activity'
self.primary_key = 'table_identifier'
def self.for_tables(tables)
Gitlab::Database::LoadBalancing::Session.current.use_primary do
where('schema = current_schema()').where(table: tables)
end
end
def to_s
"table #{table_identifier} (started: #{vacuum_start})"
end
end
end
end