Question about Re-Add Folder Import Service 3.1.x
Why does Ephesoft use 7 expression CRON configuration for READD, but in workflows, the CRON is 6 expressions in length?
CRON-Expressions are used to configure instances of CRON Trigger. CRON-Expressions strings are made up of white space separated seven sub-expressions, that describe individual details of the schedule. These seven sub expressions include:
- Year (optional field)
The default CRON expression(foldermonitor.re_add_watch.cronjob.expression=0 0 0 * * ? 2020) for the watch seems wrong as it would not happen for the next 6 years.
The default CRON expression is not wrong instead intentionally it has been set to run in year 2020. The actual purpose of this property is to re – add the folder monitor watch if somehow watch got removed due to poor network connectivity (especially in case of clustered environment when SharedFolders are on network path). Ideally, there is no point re – adding the watch on the UNC folder of Batch classes in small intervals (as this process removes watches from all the UNC folders and then re – adds it).
Thus this is an option available for users who experience such kind of problems, user can solve the problem after configuring this CRON expression as per their need.
Which is correct?:
- At CRON interval, check to see if the Folder Import service is still running and in the event that it is down, THEN restart it. – False
- At CRON interval, restart Folder Import service regardless if it is running or not. – True
What is the recommended interval for the CRON?
If Folder Import is in the middle of an operation, what is the impact of Folder Import restarting?
At CRON interval, Ephesoft removes the existing watch on the UNC folder of all the batch classes and re – add the watch to the all UNC folder. Ideally, we can’t recommend a generic interval for this CRON because it entirely depends upon the network where Ephesoft runs i.e. how frequently user experiences this problem.
In case of SharedFolders are on the on same system, we don’t recommend to run this CRON on that system as there is no chance of losing folder monitor watch on such system.
Therefore default expression for year 2020 should work fine in such case.
In case if SharedFolders are on network path then user can use CRON expression for re – adding the watch if user experiences this problem.
If network gets disconnected frequently then user can run this CRON after small interval depending on time interval of network loss (e.g. ranging in few hours) otherwise the value for the CRON expression should be fairly large enough (approx. 1 to 2 times a day). As a general recommendation we can suggest to set this CRON expression to run at an interval of 2 to 3 hours. Also it will not impact any folder import operation if it is in middle. We have already handled the same in code base.