simple_worker 0.6.5 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/simple_worker/base.rb +14 -0
- metadata +1 -1
data/lib/simple_worker/base.rb
CHANGED
@@ -348,6 +348,19 @@ module SimpleWorker
|
|
348
348
|
return merged, rfile, subclass
|
349
349
|
end
|
350
350
|
|
351
|
+
def self.extract_merged_workers(worker)
|
352
|
+
merged_workers = worker.class.instance_variable_get(:@merged_workers)
|
353
|
+
SimpleWorker.logger.debug "Looking for merged_workers in #{worker.class.name}: #{merged_workers.inspect}"
|
354
|
+
ret = []
|
355
|
+
if merged_workers && merged_workers.size > 0
|
356
|
+
merged_workers.each do |mw|
|
357
|
+
SimpleWorker.logger.debug "merged worker found in #{worker.class.name}: #{mw.inspect}"
|
358
|
+
ret << mw[0]
|
359
|
+
end
|
360
|
+
end
|
361
|
+
ret
|
362
|
+
end
|
363
|
+
|
351
364
|
def upload_if_needed
|
352
365
|
check_service
|
353
366
|
SimpleWorker.service.check_config
|
@@ -366,6 +379,7 @@ module SimpleWorker
|
|
366
379
|
mw_instantiated.upload
|
367
380
|
|
368
381
|
merged, rfile, subclass = SimpleWorker::Base.extract_superclasses_merges(mw_instantiated, merged)
|
382
|
+
merged += SimpleWorker::Base.extract_merged_workers(mw_instantiated)
|
369
383
|
|
370
384
|
end
|
371
385
|
end
|