solid_queue_monitor 2.2.1 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56966f46d6a81a73664fcad0850d60beeb87390264b9b2faf1a05d6031d38462
4
- data.tar.gz: d064fc3683c29079fa20abd92e3d01487392de7d4c66d66bcd402571e8d059a3
3
+ metadata.gz: 9ce7caf5412791eac4ac5e83446db18ef6fd4e2fcc3b9003f4f9c5f1af293406
4
+ data.tar.gz: cf320180ab3811699c73fc4cce4b8b6487623746f682fe316c398fa354f04a9d
5
5
  SHA512:
6
- metadata.gz: 357596c47791d62224e737243db5fc183eb351988caffa55cedbe351f58562ff83c8fe8f3d65fdfcb1f3de976a890963d6aa1ad68cfb88037ff0d3410ec09160
7
- data.tar.gz: aa2d8088de150fa65142d8b39088801c22b29f0fba914a74f4bf3240e2cd5017c9c48892c9ff5669a93f8526c767b0fe4146cf12b709485f726764af0d03cef6
6
+ metadata.gz: 6620380ceeb0dd83c095dc43f49df2034fa778fc739b8d7c42106f751401ebb63fe69cc2cc58b3397f214b350742685b650934e79f008bf8fab045f4e2c88b09
7
+ data.tar.gz: 527610b46ae2997c9d7c360793540f2c5ef297b5b081175bb5cf80903fbe97822d860a23d6a90f03e502f3bb54e7466c015c7f965f76a267b6bd341c89cf421d
data/README.md CHANGED
@@ -238,7 +238,7 @@ The dashboard provides several views:
238
238
  - **Overview**: Shows statistics, recent jobs, and job activity chart
239
239
  - **Ready Jobs**: Jobs that are ready to be executed
240
240
  - **Scheduled Jobs**: Jobs scheduled for future execution with execute and reject actions
241
- - **Recurring Jobs**: Jobs that run on a recurring schedule
241
+ - **Recurring Jobs**: Jobs that run on a recurring schedule, with a Run now action that enqueues one task immediately without changing its schedule
242
242
  - **Failed Jobs**: Jobs that have failed with error details and retry/discard actions
243
243
  - **Queues**: Distribution of jobs across different queues with pause/resume controls
244
244
  - **Workers**: Real-time monitoring of all Solid Queue processes with health status
@@ -12,5 +12,11 @@ module SolidQueueMonitor
12
12
  @sort = sort_params
13
13
  @action_path = recurring_jobs_path
14
14
  end
15
+
16
+ def enqueue
17
+ result = SolidQueueMonitor::EnqueueRecurringTaskService.call(params[:id])
18
+ set_flash_message(result[:message], result[:success] ? 'success' : 'error')
19
+ redirect_to recurring_jobs_path
20
+ end
15
21
  end
16
22
  end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SolidQueueMonitor
4
+ class EnqueueRecurringTaskService
5
+ class << self
6
+ def call(id)
7
+ task = SolidQueue::RecurringTask.find(id)
8
+ enqueued_job = task.enqueue(at: Time.current)
9
+
10
+ if enqueued?(enqueued_job)
11
+ { success: true, message: "Recurring task '#{task.key}' has been queued to run now" }
12
+ else
13
+ { success: false, message: "Could not enqueue recurring task '#{task.key}'. It may already be queued for this time" }
14
+ end
15
+ rescue ActiveRecord::RecordNotFound
16
+ { success: false, message: 'Recurring task not found' }
17
+ rescue StandardError => e
18
+ { success: false, message: "Failed to enqueue recurring task: #{e.message}" }
19
+ end
20
+
21
+ private
22
+
23
+ def enqueued?(enqueued_job)
24
+ enqueued_job.respond_to?(:successfully_enqueued?) && enqueued_job.successfully_enqueued?
25
+ end
26
+ end
27
+ end
28
+ end
@@ -16,24 +16,25 @@
16
16
 
17
17
  <form method="post" id="failed-jobs-form">
18
18
  <%= csrf_token_field_if_enabled %>
19
- <% columns = [
20
- { sort_key: nil, label: tag.input(type: 'checkbox', id: 'select-all', class: 'select-all-checkbox') },
21
- { sort_key: :class_name, label: 'Job' },
22
- { sort_key: :queue_name, label: 'Queue' },
23
- { sort_key: nil, label: 'Error' },
24
- { sort_key: nil, label: 'Arguments' },
25
- { sort_key: :created_at, label: 'Failed At' },
26
- { sort_key: nil, label: 'Actions' }
27
- ] %>
28
-
29
- <%= render 'solid_queue_monitor/shared/jobs_table',
30
- jobs: @failed_jobs[:records],
31
- columns: columns,
32
- sort: @sort,
33
- filters: @filters,
34
- row_partial: 'solid_queue_monitor/failed_jobs/row' %>
35
19
  </form>
36
20
 
21
+ <% columns = [
22
+ { sort_key: nil, label: tag.input(type: 'checkbox', id: 'select-all', class: 'select-all-checkbox') },
23
+ { sort_key: :class_name, label: 'Job' },
24
+ { sort_key: :queue_name, label: 'Queue' },
25
+ { sort_key: nil, label: 'Error' },
26
+ { sort_key: nil, label: 'Arguments' },
27
+ { sort_key: :created_at, label: 'Failed At' },
28
+ { sort_key: nil, label: 'Actions' }
29
+ ] %>
30
+
31
+ <%= render 'solid_queue_monitor/shared/jobs_table',
32
+ jobs: @failed_jobs[:records],
33
+ columns: columns,
34
+ sort: @sort,
35
+ filters: @filters,
36
+ row_partial: 'solid_queue_monitor/failed_jobs/row' %>
37
+
37
38
  <%= render 'solid_queue_monitor/shared/pagination',
38
39
  current_page: @failed_jobs[:current_page],
39
40
  total_pages: @failed_jobs[:total_pages] %>
@@ -5,4 +5,13 @@
5
5
  <td><%= queue_link(job.queue_name) %></td>
6
6
  <td><%= job.priority || 'Default' %></td>
7
7
  <td><%= format_datetime(job.updated_at) %></td>
8
+ <td class="actions-cell">
9
+ <form method="post"
10
+ action="<%= enqueue_recurring_job_path(job) %>"
11
+ class="inline-form"
12
+ data-confirm="Enqueue <%= job.key %> to run now? Its schedule will not change.">
13
+ <%= csrf_token_field_if_enabled %>
14
+ <button type="submit" class="action-button execute-button">Run now</button>
15
+ </form>
16
+ </td>
8
17
  </tr>
@@ -11,7 +11,8 @@
11
11
  { sort_key: nil, label: 'Schedule' },
12
12
  { sort_key: :queue_name, label: 'Queue' },
13
13
  { sort_key: :priority, label: 'Priority' },
14
- { sort_key: nil, label: 'Last Updated' }
14
+ { sort_key: nil, label: 'Last Updated' },
15
+ { sort_key: nil, label: 'Actions' }
15
16
  ] %>
16
17
 
17
18
  <%= render 'solid_queue_monitor/shared/jobs_table',
data/config/routes.rb CHANGED
@@ -11,7 +11,9 @@ SolidQueueMonitor::Engine.routes.draw do
11
11
 
12
12
  resources :ready_jobs, only: [:index]
13
13
  resources :scheduled_jobs, only: [:index]
14
- resources :recurring_jobs, only: [:index]
14
+ resources :recurring_jobs, only: [:index] do
15
+ post :enqueue, on: :member
16
+ end
15
17
  resources :failed_jobs, only: [:index]
16
18
  resources :in_progress_jobs, only: [:index]
17
19
  resources :queues, only: [:index]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidQueueMonitor
4
- VERSION = '2.2.1'
4
+ VERSION = '2.3.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solid_queue_monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vishal Sadriya
@@ -73,6 +73,7 @@ files:
73
73
  - app/services/solid_queue_monitor/asset_cache.rb
74
74
  - app/services/solid_queue_monitor/authentication_service.rb
75
75
  - app/services/solid_queue_monitor/chart_data_service.rb
76
+ - app/services/solid_queue_monitor/enqueue_recurring_task_service.rb
76
77
  - app/services/solid_queue_monitor/execute_job_service.rb
77
78
  - app/services/solid_queue_monitor/failed_job_service.rb
78
79
  - app/services/solid_queue_monitor/pagination_service.rb