Customer reports that *freshly created tasks are not always stored into the correct folder*s. While it seems that task should be added into month and day directories in JCR, that sometimes does not seem to happen. As a result, the customer ends up with too many nodes in a single folder, causing performance problems.
Please research this and provide a fix for it, if necessary.
The issue seems to be caused by the following:
info.magnolia.task.persistence.TasksStoreImpl is a singleton which is injected with TaskPathGenerator. The latter initialises
private AtomicLong atomicLong = new AtomicLong(System.currentTimeMillis());
Each time a new task is persisted (created as new or updated) the following happens at
So, the parent path (e.g. /tasks/2015/11/2) is obtained by incrementing a counter which started at some point in time in the past, i.e. when TaskPathGenerator was instantiated and not necessarily reflects the current date.