1
0
Fork 0
mirror of https://github.com/endofunky/sidetiq.git synced 2022-11-09 13:53:30 -05:00

Don't pass classes without #perform defined to handler. Fixes #115.

This commit is contained in:
Tobias Svensson 2014-09-24 09:53:14 +01:00
parent 4ab7dd5ce4
commit 3bd3524f4e

View file

@ -1,9 +1,13 @@
module Sidetiq
# Public: Sidetiq API methods.
module API
# Public: Returns an Array of workers including Sidetiq::Schedulable.
# Public: Returns an Array of workers including
# Sidetiq::Schedulable. Excludes classes which don't define
# a #perform method.
def workers
Sidetiq::Schedulable.subclasses(true)
Sidetiq::Schedulable.subclasses(true).select do |klass|
klass.method_defined?(:perform)
end
end
# Public: Returns a Hash of Sidetiq::Schedule instances.