-
Notifications
You must be signed in to change notification settings - Fork 77
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
Tweaks to garbage collection #90
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #90 +/- ##
==========================================
- Coverage 99.68% 99.48% -0.21%
==========================================
Files 14 14
Lines 955 1166 +211
==========================================
+ Hits 952 1160 +208
- Misses 3 6 +3
Continue to review full report at Codecov.
|
Would it be possible to add some unit tests? Otherwise I like this idea |
Scheduling garbage collection by time isn't appropriate for short-lived applications. This adds an alternative API which allows you to schedule the garbage collection instantly.
Defaulting to require 10% of free disk space does not make sense for some apps. For example, on a huge disk, say 64GB, there is no reason to require 6GB free space for a 30MB cache.
Tests added! I have some trouble reproducing the failed tests from travis - they are in some unchanged tests (but may be related to me changing the default disk cache size). However, they seem kind of implementation-dependent since I tried running the tests on all similar simulators on my computer. 🤔 It is probably because the code in This bug seems to have existed before, but appeared in tests now that I changed the disk sizes during testing. Suggestions for a solution? |
@@ -492,21 +492,35 @@ | |||
isa = XCBuildConfiguration; | |||
baseConfigurationReference = 9C882A801C65422700D463BB /* project.xcconfig */; | |||
buildSettings = { | |||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; |
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 want to put all of these in our xcconfig file. To keep the Xcode project clean and make it easier to maintain. See https://github.com/spotify/SPTPersistentCache/blob/master/ci/spotify_os.xcconfig
…into pull-updates-from-spotify # Conflicts: # Sources/SPTPersistentCache.m
Expose
enqueueGarbageCollection
Scheduling garbage collection by time isn't appropriate for short-lived applications. This adds an alternative API which allows you to schedule the garbage collection instantly. This fixes Scheduling of garbage collection #89
Expose
minimumFreeDiskSpaceFraction
Defaulting to require 10% of free disk space does not make sense for some apps. For example, on a huge disk, say 64GB, there is no reason to require 6GB free space for a 30MB cache.