Class: RogIQ::Remote::Queue
- Inherits:
-
CommandBase
- Object
- Thor
- CommandBase
- RogIQ::Remote::Queue
- Defined in:
- lib/rogiq/remote/queue.rb
Instance Method Summary collapse
- #drain ⇒ Object
- #flush ⇒ Object
- #pause(queue_name) ⇒ Object
- #resume(queue_name) ⇒ Object
- #retry_all ⇒ Object
- #stats ⇒ Object
Instance Method Details
#drain ⇒ Object
57 58 59 60 61 62 63 |
# File 'lib/rogiq/remote/queue.rb', line 57 def drain unless [:yes] exit 1 unless yes?("Clear ready, scheduled, and blocked executions?") end emit(api.post("/api/v1/cli/queue/drain", { confirm: true })) end |
#flush ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/rogiq/remote/queue.rb', line 21 def flush unless [:yes] exit 1 unless yes?("Discard failed executions?") end body = { confirm: true } body[:class_name] = [:class] unless [:class].to_s.strip.empty? emit(api.post("/api/v1/cli/queue/flush", body)) end |
#pause(queue_name) ⇒ Object
46 47 48 |
# File 'lib/rogiq/remote/queue.rb', line 46 def pause(queue_name) emit(api.post("/api/v1/cli/queue/pause/#{escape_queue_path(queue_name)}")) end |
#resume(queue_name) ⇒ Object
51 52 53 |
# File 'lib/rogiq/remote/queue.rb', line 51 def resume(queue_name) emit(api.post("/api/v1/cli/queue/resume/#{escape_queue_path(queue_name)}")) end |
#retry_all ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/rogiq/remote/queue.rb', line 35 def retry_all unless [:yes] exit 1 unless yes?("Retry all failed jobs?") end body = { confirm: true } body[:class_name] = [:class] unless [:class].to_s.strip.empty? emit(api.post("/api/v1/cli/queue/retry_all", body)) end |
#stats ⇒ Object
12 13 14 15 16 |
# File 'lib/rogiq/remote/queue.rb', line 12 def stats q = {} q[:by_class] = true if [:by_class] emit(api.get("/api/v1/cli/queue/stats", q)) end |