invalidate_all, delete are not valid methods for a batch in sidekiq pro

276 views
Skip to first unread message

Vivek Sura

unread,
Jan 6, 2017, 11:11:20 AM1/6/17
to Sidekiq
Hi, 

We use sidekiq pro to create batch and run some workers in the batch asynchronously. In complete callback we are trying to clear all stale workers, by doing batch.invalidate_all or batch.delete. Both of them are not valid methods as per sidekiq. Has anyone encountered a similar error before. Are both the methods depricated ? as the documentation points to both of them. Please let me know if i am searching in a totally wrong direction. 

Here is the documentation I am referring to:

Thanks,
Vivek

Mike Perham

unread,
Jan 6, 2017, 11:19:03 AM1/6/17
to sid...@googlegroups.com
What version are you running, what error are you seeing, what code are you trying to run?

--
You received this message because you are subscribed to the Google Groups "Sidekiq" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sidekiq+unsubscribe@googlegroups.com.
To post to this group, send email to sid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sidekiq/b283cb76-149a-4cd9-9d2b-1b19ccbe03b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Mike Perham – CEO, Contributed Systems
Smart, effective open source infrastructure for your apps.

Vivek Sura

unread,
Jan 6, 2017, 11:46:03 AM1/6/17
to Sidekiq
Hi Mike,

We are using sidekiq-pro 1.5.1

Here is the code :

batch = Sidekiq::Batch.new
batch.on(:complete, 'WorkerName#print_job', render_options)
dashboard_widgets.each do |widget|
# spawn workers here 
end
end
batch.invalidate_all

This is the error we encounter: 
NoMethodError: undefined method `invalidate_all' for #<Sidekiq::Batch:0x0055c8dbceb680>

Please guide me through this.

Thanks,
Vivek

Mike Perham

unread,
Jan 6, 2017, 12:01:51 PM1/6/17
to sid...@googlegroups.com
That version is like 3 years old. Upgrade. The wiki always covers the latest versions. 
--
You received this message because you are subscribed to the Google Groups "Sidekiq" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sidekiq+u...@googlegroups.com.

To post to this group, send email to sid...@googlegroups.com.

Vivek Sura

unread,
Jan 7, 2017, 5:08:11 AM1/7/17
to sid...@googlegroups.com
Thanks Mike. Will do the necessary. 

On Fri, Jan 6, 2017 at 10:31 PM, Mike Perham <mi...@contribsys.com> wrote:
That version is like 3 years old. Upgrade. The wiki always covers the latest versions. 

On Jan 6, 2017, at 08:46, Vivek Sura <vivek...@reportgarden.com> wrote:

Hi Mike,

We are using sidekiq-pro 1.5.1

Here is the code :

batch = Sidekiq::Batch.new
batch.on(:complete, 'WorkerName#print_job', render_options)
dashboard_widgets.each do |widget|
# spawn workers here 
end
end
batch.invalidate_all

This is the error we encounter: 
NoMethodError: undefined method `invalidate_all' for #<Sidekiq::Batch:0x0055c8dbceb680>

Please guide me through this.

Thanks,
Vivek

--
You received this message because you are subscribed to the Google Groups "Sidekiq" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sidekiq+unsubscribe@googlegroups.com.

To post to this group, send email to sid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sidekiq/98606a8c-dc6f-4c5c-a01e-436e2385ae6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Sidekiq" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sidekiq/oRD2c7NfMXw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sidekiq+unsubscribe@googlegroups.com.

To post to this group, send email to sid...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages