Commit 915db3d5 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'sh-fix-geo-log-cursor-reconnect' into 'master'

Fix Geo Log Cursor not reconnecting after pgbouncer dies

Closes #5145

See merge request gitlab-org/gitlab-ee!4866
parents ae2fde44 74c234f9
---
title: Fix Geo Log Cursor not reconnecting after pgbouncer dies
merge_request: !4866
author:
type: fixed
......@@ -34,8 +34,12 @@ module Gitlab
end
def run_once!
# Wrap this with the connection to make it possible to reconnect if
# PGbouncer dies: https://github.com/rails/rails/issues/29189
ActiveRecord::Base.connection_pool.with_connection do
LogCursor::Events.fetch_in_batches { |batch| handle_events(batch) }
end
end
def handle_events(batch)
batch.each do |event_log|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment