2

I am working on ROR application. i have a functionality requirement, where i have to call a method for every 30 seconds using sidekiq

and i am using these gems

# sidekiq gem 'sidekiq', '~> 3.3.0' # sidekiq scheduler gem 'sidekiq-scheduler', '~> 2.0' 

here is my scheduler.yml file code.

perform: every: ["30s"] class: Aggregator queue: aggregation description: "This job will create Aggregate data." 

here is my Aggregator class which inside the Workers folder.

class Aggregator include Sidekiq::Worker sidekiq_options :backtrace => 5, :retry => false def perform end_time = time - (time.sec%30).seconds puts "ROUNDING TO 30 SEC" puts end_time Session.create_aggregate_data(end_time) end end 

when i am checking the sidekiq logs it's not hitting the perform method. but the Aggregator class is getting called

here are the logs..

2016-07-27T10:19:59.436Z 15117 TID-1qjnlu INFO: queueing Aggregator (perform) 2016-07-27T10:20:29.641Z 15117 TID-1qjnlu INFO: queueing Aggregator (perform) 2016-07-27T10:20:59.836Z 15117 TID-1qjnlu INFO: queueing Aggregator (perform) 2016-07-27T10:21:30.009Z 15117 TID-1qjnlu INFO: queueing Aggregator (perform) 2016-07-27T10:22:00.204Z 15117 TID-1qjnlu INFO: queueing Aggregator (perform) 2016-07-27T10:22:30.507Z 15117 TID-1qjnlu INFO: queueing Aggregator (perform) 2016-07-27T10:23:00.509Z 15117 TID-1qjnlu INFO: queueing Aggregator (perform) 2016-07-27T10:23:30.760Z 15117 TID-1qjnlu INFO: queueing Aggregator (perform) 2016-07-27T10:24:01.068Z 15117 TID-1qjnlu INFO: queueing Aggregator (perform) 
2
  • So the jobs are being queued but they are not being processed. Silly question: have you started sidekiq? bundle exec sidekiq ? Commented Jul 27, 2016 at 10:47
  • thanks for responding.. @MrWillihog. these logs are coming, when I ran the 'sidekiq' command Commented Jul 27, 2016 at 10:57

1 Answer 1

0

Try to set queue to default if you didn't configure non-default queues

queue: default 
Sign up to request clarification or add additional context in comments.

1 Comment

Nope, Workers don't need to end in Worker, that's just the naming convention.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.