Closed
Description
Dan Checkoway opened SPR-7022 and commented
@Scheduled
is the coolest thing ever...but it could really use an "initialDelay" parameter. Otherwise there's no way (that I'm aware of) to configure a @Scheduled
method to run after a specified delay.
Without it, I'm forced to use the likes of TaskScheduler.scheduleAtFixedRate(Runnable, Date, long) and pass it a startDate...and then I'm forced to wrap a Runnable around my method, etc. That's so old school! :-)
Anyway, please consider my humble request for an optional "initialDelay" such as:
@Scheduled
(fixedRate=60000,initialDelay=20000)
and
@Scheduled
(fixedDelay=30000,initialDelay=30000)
Attachments:
- scheduled-initial-delay-patch.diff (12.61 kB)
Issue Links:
- Deadlock between DefaultListableBeanFactory and DefaultSingletonBeanRegistry, perhaps due to lazily-instantiated aspect [SPR-7718] #12374 Deadlock between DefaultListableBeanFactory and DefaultSingletonBeanRegistry, perhaps due to lazily-instantiated aspect
Referenced from: commits 5330c52, 53673d6
25 votes, 24 watchers