Return database connections to the pool after each qless job - #349
Conversation
This fixes an issue where workers could fail to judge submissions if the database connection was dropped (e.g. because postgresql was restarted).
|
A summary of some messages from Discord for posterity: The qless README suggests using ActiveRecord::Base.establish_connection, but that caused a PG::UnableToSend exception (hence the use of with_connection in this PR). |
Yeah, it'll still throw an error in that case, but this at least seems to allow workers to automatically recover from the broken connection (on the next job) rather than failing on all subsequent submissions. Hopefully it's good enough for now. Thanks for reviewing. |
This fixes an issue where workers could fail to judge submissions if the database connection was dropped (e.g. because postgresql was restarted).
https://discord.com/channels/670126531489824788/678154623571329025/1485894172748550185