-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DB connection leak #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI is failing, can you help fix it
Yeah I'm looking at it, quite weird because originally tests passed for me with the system Ruby, but they fail when 3.1.2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, could you add a test?
how do we carry out the test? trigger the worker and see if there's any |
I wanted to just do |
Maybe this is because of the simpler DB setup (just using SQLite)? Hieu, do you have any advice how to carry out the test reliably? |
@martonarbocz you can try assert the value of |
Thank you sir, that works 💯 |
before do | ||
db.create_table(:data_migrations) do | ||
String :version, null: false, primary: true | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to create the table because the migrator will create the table if it does not exist.
https://kaligo.slack.com/archives/C01LK7XLGE9/p1704682961528359
We discovered that using Sequel.connect to return the connection actually leaks it. Let's use a block instead.