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:
parent
4ab7dd5ce4
commit
3bd3524f4e
1 changed files with 6 additions and 2 deletions
|
@ -1,9 +1,13 @@
|
||||||
module Sidetiq
|
module Sidetiq
|
||||||
# Public: Sidetiq API methods.
|
# Public: Sidetiq API methods.
|
||||||
module API
|
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
|
def workers
|
||||||
Sidetiq::Schedulable.subclasses(true)
|
Sidetiq::Schedulable.subclasses(true).select do |klass|
|
||||||
|
klass.method_defined?(:perform)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Public: Returns a Hash of Sidetiq::Schedule instances.
|
# Public: Returns a Hash of Sidetiq::Schedule instances.
|
||||||
|
|
Loading…
Reference in a new issue