rocketjob 6.2.0 → 6.3.0
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 +4 -4
- data/lib/rocket_job/batch/worker.rb +2 -2
- data/lib/rocket_job/category/base.rb +1 -1
- data/lib/rocket_job/category/input.rb +1 -1
- data/lib/rocket_job/jobs/copy_file_job.rb +1 -0
- data/lib/rocket_job/jobs/upload_file_job.rb +8 -1
- data/lib/rocket_job/rocket_job.rb +3 -0
- data/lib/rocket_job/sliced/input.rb +2 -2
- data/lib/rocket_job/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a90e66a2d150e503e939735d7913b016e3cea3a9a43b6ae0751b101768f10c5c
|
4
|
+
data.tar.gz: bc0029bffda1dfa575984352c1284aaec8e93d8cb0f81789ae253740de3cc4d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4350c6360df190ccb0c251944cf4bf5bc20de512779b5f6e0107571c049f7adc2e589de63ba350d1c179505e3af2ff5610220edbfc9e43f4c0abff4943448ee6
|
7
|
+
data.tar.gz: 9924be8c32392448e6285e9f2a94c1da26abd5b29a2d2aa7d60ff0cee8e34c61cedd6c69cc109894dfeaa9e5ce5dcfea0b2084bacce0493b2e44c5c6f2c813fc
|
@@ -226,7 +226,7 @@ module RocketJob
|
|
226
226
|
result = self.class.with(write: {w: 1}) do |query|
|
227
227
|
query.
|
228
228
|
where(id: id, state: :running, sub_state: :processing).
|
229
|
-
update("$set" => {sub_state:
|
229
|
+
update("$set" => {sub_state: "after", worker_name: worker_name})
|
230
230
|
end
|
231
231
|
|
232
232
|
# Reload to pull in any counters or other data that was modified.
|
@@ -251,7 +251,7 @@ module RocketJob
|
|
251
251
|
result = self.class.with(write: {w: 1}) do |query|
|
252
252
|
query.
|
253
253
|
where(id: id, state: :running, sub_state: :processing).
|
254
|
-
update({"$set" => {state:
|
254
|
+
update({"$set" => {state: "failed", worker_name: worker_name}})
|
255
255
|
end
|
256
256
|
fail_job = false unless result.modified_count.positive?
|
257
257
|
end
|
@@ -61,7 +61,7 @@ module RocketJob
|
|
61
61
|
@tabular ||= IOStreams::Tabular.new(
|
62
62
|
columns: columns,
|
63
63
|
format: format == :auto ? nil : format,
|
64
|
-
format_options: format_options&.deep_symbolize_keys,
|
64
|
+
format_options: format_options&.to_h&.deep_symbolize_keys,
|
65
65
|
file_name: file_name
|
66
66
|
)
|
67
67
|
end
|
@@ -99,7 +99,7 @@ module RocketJob
|
|
99
99
|
@tabular ||= IOStreams::Tabular.new(
|
100
100
|
columns: columns,
|
101
101
|
format: format == :auto ? nil : format,
|
102
|
-
format_options: format_options&.deep_symbolize_keys,
|
102
|
+
format_options: format_options&.to_h&.deep_symbolize_keys,
|
103
103
|
file_name: file_name,
|
104
104
|
allowed_columns: allowed_columns,
|
105
105
|
required_columns: required_columns,
|
@@ -26,6 +26,7 @@ module RocketJob
|
|
26
26
|
self.destroy_on_complete = false
|
27
27
|
# Number of times to automatically retry the copy. Set to `0` for no retry attempts.
|
28
28
|
self.retry_limit = 10
|
29
|
+
self.prioriy = 30
|
29
30
|
|
30
31
|
# File names in IOStreams URL format.
|
31
32
|
field :source_url, type: String, user_editable: true
|
@@ -59,7 +59,14 @@ module RocketJob
|
|
59
59
|
if job.respond_to?(:upload)
|
60
60
|
# Return the database connection for this thread back to the connection pool
|
61
61
|
# in case the upload takes a long time and the database connection expires.
|
62
|
-
|
62
|
+
if defined?(ActiveRecord::Base)
|
63
|
+
if ActiveRecord::Base.respond_to?(:connection_handler)
|
64
|
+
# Rails 7
|
65
|
+
ActiveRecord::Base.connection_handler.clear_active_connections!
|
66
|
+
else
|
67
|
+
ActiveRecord::Base.connection_pool.release_connection
|
68
|
+
end
|
69
|
+
end
|
63
70
|
|
64
71
|
if original_file_name
|
65
72
|
job.upload(upload_file_name, file_name: original_file_name)
|
@@ -105,7 +105,7 @@ module RocketJob
|
|
105
105
|
def requeue_failed
|
106
106
|
failed.update_all(
|
107
107
|
"$unset" => {worker_name: nil, started_at: nil},
|
108
|
-
"$set" => {state:
|
108
|
+
"$set" => {state: "queued"}
|
109
109
|
)
|
110
110
|
end
|
111
111
|
|
@@ -113,7 +113,7 @@ module RocketJob
|
|
113
113
|
def requeue_running(worker_name)
|
114
114
|
running.where(worker_name: /\A#{worker_name}/).update_all(
|
115
115
|
"$unset" => {worker_name: nil, started_at: nil},
|
116
|
-
"$set" => {state:
|
116
|
+
"$set" => {state: "queued"}
|
117
117
|
)
|
118
118
|
end
|
119
119
|
|
data/lib/rocket_job/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocketjob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reid Morrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aasm
|