Sha256: 9dc807e746f026dc9e44a6ba3d593309bad2260fdda33d67a3667f15645b27a4
Contents?: true
Size: 601 Bytes
Versions: 2
Compression:
Stored size: 601 Bytes
Contents
module PgHero module Methods module Kill def kill(pid) execute("SELECT pg_terminate_backend(#{pid.to_i})").first["pg_terminate_backend"] == "t" end def kill_long_running_queries long_running_queries.each { |query| kill(query["pid"]) } true end def kill_all select_all <<-SQL SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid <> pg_backend_pid() AND query <> '<insufficient privilege>' SQL true end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
pghero-1.2.4 | lib/pghero/methods/kill.rb |
pghero-1.2.3 | lib/pghero/methods/kill.rb |