Skip to content

Support initial delay attribute for @Scheduled and <task:scheduled> [SPR-7022] #11684

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Issue Links:

Referenced from: commits 5330c52, 53673d6

25 votes, 24 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    has: votes-jiraIssues migrated from JIRA with more than 10 votes at the time of importin: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions