مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-11-30 21:32:30 +00:00
fix: retry mysql connections on message DB pool
هذا الالتزام موجود في:
@@ -12,9 +12,11 @@ module Postal
|
||||
end
|
||||
|
||||
def use
|
||||
connection = checkout
|
||||
retried = false
|
||||
do_not_checkin = false
|
||||
begin
|
||||
connection = checkout
|
||||
|
||||
yield connection
|
||||
rescue Mysql2::Error => e
|
||||
if e.message =~ /(lost connection|gone away|not connected)/i
|
||||
@@ -22,6 +24,12 @@ module Postal
|
||||
# we won't add it back in to the pool so that it'll reconnect
|
||||
# next time.
|
||||
do_not_checkin = true
|
||||
|
||||
# If we haven't retried yet, we'll retry the block once more.
|
||||
if retried == false
|
||||
retried = true
|
||||
retry
|
||||
end
|
||||
end
|
||||
|
||||
raise
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم