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

Steps to reproduce

etc/config.properties contains:

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

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

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());

?

Status

Assignee

Lars Kiesow

Reporter

Stephen Marquard

Severity

Incorrectly Functioning Without Workaround

Tags (folksonomy)

None

Components

Fix versions

Affects versions

Priority

Critical
Configure