Dear David,
Writing my first tasklets, I found two minor problems with the org.openntf.javaddin.task extension point's runOnStart attribute and its associated behavior:
1. There is a mismatch between the documented (true) and actual (ServerTaskInfo.bRunOnStart not initialized) default value.
2. Sometimes the initial run is delayed or not executed at all.
Looking at the source code of ServerTaskManager, I found that the initial run is done in performRun(), which is called by addinDispatch() if there are scheduledRuns and a run is actually due. This has the following consequences:
-
the initial run is not called at all if there are no scheduled runs
-
the initial run is delayed until the first scheduled run
Maybe this could be fixed by promoting the treatment of initial runs up to addinDispatch().
Thanks for this great project! - Harald Albers