Skip to content
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

Close connections after every async job that uses the db #2342

Merged

Conversation

acelaya
Copy link
Member

@acelaya acelaya commented Jan 27, 2025

Closes #2341

Decorate UpdateGeoLiteDb and SendVisitToMatomo with the CloseDbConnectionEventListener.

That ensures any database connection opened for them is closed afterwards, which is specially important for the geolite one, as it runs for every single visit.

This job didn't use to interact with the database before Shlink 4.4, so it was intentionally not decorated.

SendVisitToMatomo has always interacted with the database, it was just overlooked, but anyone not using this feature would not notice it.

Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.75%. Comparing base (1549509) to head (3372a2a).
Report is 3 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #2342   +/-   ##
==========================================
  Coverage      93.75%   93.75%           
  Complexity      1696     1696           
==========================================
  Files            276      276           
  Lines           5873     5873           
==========================================
  Hits            5506     5506           
  Misses           367      367           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@acelaya acelaya force-pushed the feature/too-many-connections branch from 15d0cfc to 3372a2a Compare January 27, 2025 14:45
@acelaya acelaya merged commit 88e97f1 into shlinkio:develop Jan 27, 2025
23 checks passed
@acelaya acelaya deleted the feature/too-many-connections branch January 27, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DB Error 1040: Shlink hogging database connections resulting in too many connections error
1 participant