rocketjob 6.2.0 → 6.3.1
Sign up to get free protection for your applications and to get access to all the features.
- 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: b8336e04f006f7f395a45c12f1456003e406791e83d56e305ed2358deb81d9c8
|
4
|
+
data.tar.gz: fc968d12498d87a462a7957138359853bba67b90251433a6e3688ca0a2c90752
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e942f816fbbdef56b62aa996437f0087ff788521aa14f090de61ad91f8e1d46fa199ad7d9c7fd0b9faf0c4d18143af0f6cfb7665b591fd229bfc71bf25cd02b
|
7
|
+
data.tar.gz: 866b516729c28c67e0d2a8412bb3a4aee20f7ce7bd8e5664f998bbe97a398e10bc05986d194703c560e41e78de4c4b9bb1f03e33ff89b29894305bb510ea624f
|
@@ -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.priority = 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.1
|
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-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aasm
|