1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-12-01 05:43:04 +00:00

fix: retry mysql connections on message DB pool

هذا الالتزام موجود في:
Adam Cooke
2024-02-13 15:56:40 +00:00
الأصل b8cb563553
التزام f9f7fb30fe
2 ملفات معدلة مع 20 إضافات و1 حذوفات

عرض الملف

@@ -41,5 +41,16 @@ describe Postal::MessageDB::ConnectionPool do
end.to raise_error Mysql2::Error
expect(pool.connections).to eq []
end
it "retries the block once if there is a connection error" do
clients_seen = []
expect do
pool.use do |client|
clients_seen << client
raise Mysql2::Error, "lost connection to server"
end
end.to raise_error Mysql2::Error
expect(clients_seen.uniq.size).to eq 2
end
end
end