-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[#1878] User definable duplication for DeduplicationHandler #1879
Conversation
$yesterday = time() - 86400; | ||
for ($i = 0; $i < count($store); $i++) { | ||
if (substr($store[$i], 0, 10) < $yesterday) { | ||
$gc = true; | ||
break; | ||
} | ||
} |
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.
I would rather keep the gc property and have isDuplicate set it to true if an older entry is found, because the way this works here, if you override the file format in buildDeduplicationStoreEntry/isDuplicate, then you may break the GC functionality.
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.
Fair point! I moved the GC trigger back to isDuplicate()
, readded the property and added a comment to isDuplicate()
which hopefully explains to overwriters that they should set $this->gc
.
I hope the failing CI workflow is not a huge problem. I am not sure what to do about it, because my changes do not seem to be responsible.
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.
Nope there's a mess on CI right now, I'm on it :)
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.
Thanks for the updates, found a couple nitpicks still
Thanks! |
This is a draft to solve #1878
Feel free to comment on the changes I made!
Although the tests ran through without modification, this change is not backwards compatible when you look at it closely, because it changes the signature of several methods (changed visibility from private to protected, add parameters etc.).