diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/database/connection_pool.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab/database/connection_pool.rb b/lib/gitlab/database/connection_pool.rb index 7cc1604559c..fb4c55a8ac0 100644 --- a/lib/gitlab/database/connection_pool.rb +++ b/lib/gitlab/database/connection_pool.rb @@ -23,11 +23,13 @@ module Gitlab @ar_pool.spec.config[:pool] end - def execute_async(sql) + # Pass `method: :exec_query` if we want unified result from query + # across PostgreSQL and MySQL + def execute_async(sql, method: :execute) @mutex.synchronize do @workers << Thread.new do @ar_pool.with_connection do |connection| - connection.execute(sql) + connection.public_send(method, sql) end end end |