mission_control-jobs 0.2.2 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/app/helpers/mission_control/jobs/application_helper.rb +1 -1
- data/app/helpers/mission_control/jobs/{ui_helper.rb → interface_helper.rb} +1 -1
- data/lib/active_job/queue_adapters/solid_queue_ext/recurring_tasks.rb +13 -20
- data/lib/active_job/queue_adapters/solid_queue_ext.rb +1 -1
- data/lib/mission_control/jobs/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2296e3b78c4cd2ca39de903ff7eaf2b198147b596fdc615143b3a58ea7d0e940
|
4
|
+
data.tar.gz: 7a3289d51f83098ef40a2ae8768b838f3d695617ea312a9704627a37d4159ae8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 198595c5e3d82916c17d175ee542412e1cfe7dd718394f1f1878049dbaf0dc718b84ba6c01ee74e716060747ff3e947175170b43c69884299d1c1a114d26e2ec
|
7
|
+
data.tar.gz: 3f4fecc8444f2f8aea8d6aa5cd91361b2daf128e59e6a5d4fe0a41f2bb8b46fe3aed12cbf2fbc8254e7c0c39a768db6bc4aef81a45b35c43e1b0a61a38c3c980
|
data/README.md
CHANGED
@@ -65,6 +65,7 @@ This library extends Active Job with a querying interface and the following sett
|
|
65
65
|
## Adapter Specifics
|
66
66
|
|
67
67
|
- **Resque**: Queue pausing is supported only if you have `resque-pause` installed in your project
|
68
|
+
- **Solid Queue**: Requires version >= 0.5.
|
68
69
|
|
69
70
|
## Advanced configuration
|
70
71
|
|
@@ -3,6 +3,6 @@ module MissionControl::Jobs
|
|
3
3
|
# Explicit helper inclusion because ApplicationController inherits from the host app.
|
4
4
|
#
|
5
5
|
# We can't rely on +config.action_controller.include_all_helpers = true+ in the host app.
|
6
|
-
include DatesHelper, JobsHelper, NavigationHelper,
|
6
|
+
include DatesHelper, JobsHelper, NavigationHelper, InterfaceHelper
|
7
7
|
end
|
8
8
|
end
|
@@ -4,36 +4,29 @@ module ActiveJob::QueueAdapters::SolidQueueExt::RecurringTasks
|
|
4
4
|
end
|
5
5
|
|
6
6
|
def recurring_tasks
|
7
|
-
tasks =
|
8
|
-
last_enqueued_at_times = recurring_task_last_enqueued_at(tasks.
|
7
|
+
tasks = SolidQueue::RecurringTask.all
|
8
|
+
last_enqueued_at_times = recurring_task_last_enqueued_at(tasks.map(&:key))
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
last_enqueued_at: last_enqueued_at_times[task_id]
|
10
|
+
tasks.collect do |task|
|
11
|
+
recurring_task_attributes_from_solid_queue_recurring_task(task).merge \
|
12
|
+
last_enqueued_at: last_enqueued_at_times[task.key]
|
14
13
|
end
|
15
14
|
end
|
16
15
|
|
17
16
|
def find_recurring_task(task_id)
|
18
|
-
if
|
19
|
-
|
20
|
-
|
21
|
-
last_enqueued_at: recurring_task_last_enqueued_at(task_id).values&.first
|
17
|
+
if task = SolidQueue::RecurringTask.find_by(key: task_id)
|
18
|
+
recurring_task_attributes_from_solid_queue_recurring_task(task).merge \
|
19
|
+
last_enqueued_at: recurring_task_last_enqueued_at(task.key).values&.first
|
22
20
|
end
|
23
21
|
end
|
24
22
|
|
25
23
|
private
|
26
|
-
def
|
27
|
-
SolidQueue::Process.where(kind: "Dispatcher").flat_map do |process|
|
28
|
-
process.metadata["recurring_schedule"]
|
29
|
-
end.compact.reduce({}, &:merge)
|
30
|
-
end
|
31
|
-
|
32
|
-
def recurring_task_attributes_from_solid_queue_task_attributes(task_attributes)
|
24
|
+
def recurring_task_attributes_from_solid_queue_recurring_task(task)
|
33
25
|
{
|
34
|
-
|
35
|
-
|
36
|
-
|
26
|
+
id: task.key,
|
27
|
+
job_class_name: task.class_name,
|
28
|
+
arguments: task.arguments,
|
29
|
+
schedule: task.schedule
|
37
30
|
}
|
38
31
|
end
|
39
32
|
|
@@ -118,7 +118,7 @@ module ActiveJob::QueueAdapters::SolidQueueExt
|
|
118
118
|
ActiveJob::ExecutionError.new \
|
119
119
|
error_class: solid_queue_job.failed_execution.exception_class,
|
120
120
|
message: solid_queue_job.failed_execution.message,
|
121
|
-
backtrace: solid_queue_job.failed_execution.backtrace
|
121
|
+
backtrace: solid_queue_job.failed_execution.backtrace || []
|
122
122
|
end
|
123
123
|
end
|
124
124
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mission_control-jobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jorge Manrubia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
103
|
+
version: '0.5'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
110
|
+
version: '0.5'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: selenium-webdriver
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -310,9 +310,9 @@ files:
|
|
310
310
|
- app/controllers/mission_control/jobs/workers_controller.rb
|
311
311
|
- app/helpers/mission_control/jobs/application_helper.rb
|
312
312
|
- app/helpers/mission_control/jobs/dates_helper.rb
|
313
|
+
- app/helpers/mission_control/jobs/interface_helper.rb
|
313
314
|
- app/helpers/mission_control/jobs/jobs_helper.rb
|
314
315
|
- app/helpers/mission_control/jobs/navigation_helper.rb
|
315
|
-
- app/helpers/mission_control/jobs/ui_helper.rb
|
316
316
|
- app/javascript/mission_control/jobs/application.js
|
317
317
|
- app/javascript/mission_control/jobs/controllers/application.js
|
318
318
|
- app/javascript/mission_control/jobs/controllers/form_controller.js
|