Skip to content

Schedule a task which repeats every 12 hours at 5:30am & pm? #17

@MSeneadza

Description

@MSeneadza

Is is possible, which 1 config file entry, to schedule a task which repeats every 12 hours at specific times (like 5:30am and 5:30pm)? I just entered this:

reset_cache:
  class: "RefreshCacheWorker"
  every: "12.hours"
  at: "05:30"
  tz: "America/New_York"```

But what I got was that task scheduled twice at 5:30am tomorrow:

[ActiveJob] [SimpleScheduler::SchedulerJob] [0ea4ed14-aa7c-4bde-bc1a-b07a2577b75f] Enqueued SimpleScheduler::FutureJob (Job ID: 9b5c4f0c-1a78-49c1-8ad5-7aabad669720) to Sidekiq(default) at 2017-03-30 09:30:00 UTC with arguments: {:class=>"RefreshCacheWorker", :every=>"12.hours", :at=>"05:30", :tz=>"America/New_York", :queue_ahead=>360, :name=>"reset_cache"}, 1490866200
[ActiveJob] [SimpleScheduler::SchedulerJob] [0ea4ed14-aa7c-4bde-bc1a-b07a2577b75f] Enqueued SimpleScheduler::FutureJob (Job ID: cee4d457-fa81-47e8-ad5b-105afe21eaef) to Sidekiq(default) at 2017-03-30 09:30:00 UTC with arguments: {:class=>"RefreshCacheWorker", :every=>"12.hours", :at=>"05:30", :tz=>"America/New_York", :queue_ahead=>360, :name=>"reset_cache"}, 1490866200


I know I could easily do what I want with two separate config entries (daily at 5:30am and daily @ 5:30pm) but I just thought I'd ask in case there was a way to do it in one config entry.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions