FIX: ensures reports can't modify records (#8006)
This commit is contained in:
parent
50368940f7
commit
0a6d1b687c
|
@ -83,6 +83,8 @@ class Report
|
|||
|
||||
def self.wrap_slow_query(timeout = 20000)
|
||||
ActiveRecord::Base.connection.transaction do
|
||||
# Allows only read only transactions
|
||||
DB.exec "SET TRANSACTION READ ONLY"
|
||||
# Set a statement timeout so we can't tie up the server
|
||||
DB.exec "SET LOCAL statement_timeout = #{timeout}"
|
||||
yield
|
||||
|
|
Loading…
Reference in New Issue