Skip to content

Make GeoLite2 file decompression memory efficient#72

Closed
acelaya wants to merge 1 commit intoshlinkio:mainfrom
acelaya-forks:feature/buffered-download
Closed

Make GeoLite2 file decompression memory efficient#72
acelaya wants to merge 1 commit intoshlinkio:mainfrom
acelaya-forks:feature/buffered-download

Conversation

@acelaya
Copy link
Member

@acelaya acelaya commented Sep 4, 2025

Closes #71

Refactor logic to decompress a GeoLite2 db file once it has been downloaded, so that we don't try to load the whole file in memory, but do it in chunks instead.

This ensures Shlink does not crash if the amount of memory reserved for it is lower than the GeoLite db file size.

@acelaya acelaya force-pushed the feature/buffered-download branch 2 times, most recently from 62317b4 to af0d94e Compare September 6, 2025 10:12
@codecov
Copy link

codecov bot commented Sep 6, 2025

Codecov Report

❌ Patch coverage is 82.35294% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.11%. Comparing base (44c4c06) to head (af0d94e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/GeoLite2/DbUpdater.php 79.06% 9 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main      #72      +/-   ##
============================================
- Coverage     97.02%   91.11%   -5.92%     
- Complexity       36       46      +10     
============================================
  Files            11       11              
  Lines           101      135      +34     
============================================
+ Hits             98      123      +25     
- Misses            3       12       +9     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@acelaya acelaya marked this pull request as draft September 6, 2025 10:42
@acelaya acelaya force-pushed the feature/buffered-download branch from af0d94e to a4ba997 Compare September 6, 2025 10:42
@acelaya
Copy link
Member Author

acelaya commented Sep 10, 2025

Superseded by #73

@acelaya acelaya closed this Sep 10, 2025
@acelaya acelaya deleted the feature/buffered-download branch September 10, 2025 06:45
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.

Try to buffer decompressing and moving of geolite file

1 participant