-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Mattias Severson opened SPR-10456 and commented
I suggest that a new timezone
element is added to the @Scheduled
annotation that can be used in conjunction with the cron
element.
Background:
Currently, it is not possible to specify a time zone to the cron
element of the @Scheduled
annotation. As a consequence, the CronSequenceGenerator
constructor calls TimeZone.getDefault()
internally, which causes the cron job to depend on the local time of the server that the app has been deployed on.
The idea is that the new timezone
element should be converted into a TimeZone
instance, that can be used to when calling the appropriate CronTrigger
constructor, which in turn calls the appropriate constructor of the CronSequenceGenerator
.
For the record, the standard the CronExpression
class in the Quartz Scheduler project has a setTimeZone() method that solves this use case.
Affects: 3.2.2
Referenced from: commits 0c00b0d
1 votes, 4 watchers