'Terminate job triggered by quartz scheduler after configurable duration
We have a batch job that needs to be executed during non-business hours. The job purges archived data, based on rules, from an OLTP database. To avoid impact on end users working using the online app, the job is scheduled in non-business hours.
Job is implemented using Java and scheduled using a quartz scheduler that is bundled with Liferay. Using cron expressions, it is possible to specify the time to trigger the job but we are unable to find a way to specify termination condition. It was noticed that a time range for hours in cron expression applies only to job triggering event. We tried capturing the processId for job but it is not available. Looking for a mechanism to specify termination condition for job.
Please share if you have any suggestions around this.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
