[
https://issues.apache.org/jira/browse/SLING-5422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stefan Seifert updated SLING-5422:
----------------------------------
Affects Version/s: Event 4.0.0
Fix Version/s: Event 4.1.0
thanks! - i've created a svn patch file from your git branch and added the
missing apache file header to the new unit test class (and reformatted it to 4
space indentation).
[^SLING-5422_cnagel.patch]
you patch looks good and should fix the problem.
the code surrounding the the fix with the oldMonth/Day/Hour/Minute checks is
still wrong, though. same applies to the code in CleanUpTask. all these
old-checks may mark folder resources as "old" that are not old if there are
multiple years, months, days, hours etc. between the removeDate and the folder
date. in practice this should causes no harm, because removing folder takes
only place if there are empty.
so the question is if we should refactor the whole code in both classes
(perhaps removing code duplication between both at the same time), or just
apply the patch for now to fix the problem described in this issue.
[~cziegeler] do you have an opinion?
> Sling Event - HistoryCleanUpTask removes Jobs younger than configured
> ---------------------------------------------------------------------
>
> Key: SLING-5422
> URL: https://issues.apache.org/jira/browse/SLING-5422
> Project: Sling
> Issue Type: Bug
> Components: Extensions
> Affects Versions: Event 4.0.0
> Reporter: Christoph Nagel
> Priority: Minor
> Fix For: Event 4.1.0
>
> Attachments: SLING-5422_cnagel.patch
>
>
> The HistoryCleanUpTask has to remove all Jobs stored in the JCR older than
> the given parameter {{age}} (a number of minutes).
> The current implementation traverses the _/var/eventing/jobs_ tree where
> parts of the path define the date of a job. Problem: the comparison of the
> job- and {{removeDate}} is wrong. First it compares the years, than months,
> weeks and days but this doesn't work.
> I've forked the project on github and wrote a test and fix. Further I added a
> test dependency for sling-mock in the pom.xml: [Fixes HistoryCleanUpTask date
> comparison|https://github.com/cnagel/sling/commit/165a8a04a129a4669599c6b15f48f67060e6c83c].
> Please have a look and if you like I can create a pull request on GitHub.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)