Skip to content

Conversation

boduoduo
Copy link

No description provided.

@3lvis
Copy link
Collaborator

3lvis commented Jun 21, 2022

Wait, are you telling me this code was wrong all this time and no one noticed? :O

@boduoduo
Copy link
Author

I viewed the apple developer document,timeIntervalSinceReferenceDate returns the interval between the date object and 00:00:00 UTC on 1 January 2001, so if using time1 > time2, the recent files will be in the front of the files sorted, and they will be removed in advance.

@dfmuir
Copy link

dfmuir commented Aug 16, 2024

I came here to open this exact pull request. Right now when calling removeExpiredObjects with cache size above its maxSize the most recently cached files are deleted. It seems clear that the oldest objects should be removed instead.

I would love to avoid forking this repo. @3lvis please consider merging this important bugfix.

@3lvis 3lvis merged commit 24e4710 into hyperoslo:master Aug 27, 2024
@3lvis
Copy link
Collaborator

3lvis commented Aug 27, 2024

Merged @dfmuir !

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.

3 participants