Workspace cleaner job param in wrong units (ms vs s) and wrong logic

Steps to reproduce

etc/ contains:

  1. The maximum age a file must reach in seconds before a deletion of the file in the workspace cleanup operation is performed

but in modules/matterhorn-workspace-impl/src/main/java/org/opencastproject/workspace/impl/

we have this comparison:

maxAgeReached = FileUtils.isFileOlder(file, new Date().getTime() + maxAge.get());

java.util.Date.getTime() is milliseconds. So maxAge is being interpreted as a ms value which means that instead of the default value being equal to 30 days, it is actually 43min.

Plus the logic of this looks wrong - surely

maxAgeReached = FileUtils.isFileOlder(file, new Date().getTime() - maxAge.get());



Lars Kiesow
October 22, 2015, 10:01 AM

you assigned this to yourself which made me stop working on this issue. Do you actually still work on this? Otherwise please assign this ticket to me and I will fix this.

Lukas Rohner
October 22, 2015, 11:30 AM

Feel free to work on it.

Lars Kiesow
October 22, 2015, 12:19 PM

ok, I'll then take over

Lars Kiesow
October 22, 2015, 9:59 PM

Good news first: The main issues of this ticket (ms vs s) are already fixed with commit 865669a3 from Lukas. But there are still a couple of issues that were described here in the comments left. I'll create a pull request to fix them as well.

Lars Kiesow
October 23, 2015, 8:31 PM

is a simplified version of the patch for 1.x that just makes sure the maxAge is interpreted correctly.
is a larger patch fot 2.1 which fixes all the issues that have been raised on this ticket, including all the comments.

Fixed and reviewed


Lars Kiesow


Stephen Marquard


Incorrectly Functioning Without Workaround

Tags (folksonomy)



Fix versions

Affects versions