Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-7022

Support initial delay attribute for @Scheduled and <task:scheduled>

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 3.2 M1
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      @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

            Activity

              People

              • Assignee:
                cbeams Chris Beams
                Reporter:
                dcheckoway Dan Checkoway
                Last updater:
                Trevor Marshall
              • Votes:
                25 Vote for this issue
                Watchers:
                24 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 1 week, 3 days ago

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 2d
                  2d