Class: Delayed::Worker
- Inherits:
-
Object
- Object
- Delayed::Worker
- Defined in:
- lib/app/models/delayed/worker.rb
Overview
Override the start and stop of the worker itself to capture start/end of the worker lifecycle
Instance Method Summary collapse
-
#start ⇒ Object
Starting the worker.
-
#stop ⇒ Object
Stop the worker.
Instance Method Details
#start ⇒ Object
Starting the worker
11 12 13 14 |
# File 'lib/app/models/delayed/worker.rb', line 11 def start super Delayed::Jobs::Worker.find_or_create_server end |
#stop ⇒ Object
Stop the worker
19 20 21 22 |
# File 'lib/app/models/delayed/worker.rb', line 19 def stop Delayed::Jobs::Worker.find_server&.stop super end |