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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d12a5469219af4b5781c67cf65670879f1fa349e42509431e5924015a52b4542
4
- data.tar.gz: 745bbcfb5cc47a3413edf874b088b81382ccc185218aac3648adb1250e51b803
3
+ metadata.gz: a90e66a2d150e503e939735d7913b016e3cea3a9a43b6ae0751b101768f10c5c
4
+ data.tar.gz: bc0029bffda1dfa575984352c1284aaec8e93d8cb0f81789ae253740de3cc4d9
5
5
  SHA512:
6
- metadata.gz: 012b3adb126e452c3ab4409d38d1fe02499cfc5049d5cc30074a1f607245e8da1327ad1a0a4b738ec290bcaf233cb7388132828d6f8f1684bdd70a1e17eb7c55
7
- data.tar.gz: f8a1899798671265395f72d259afce338bea6e555755c33fdfa11928e10b14f29cc868570caa39f091f6863fa3c8809ab8874a6ba81b8b210c36c63e4454cf2b
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: :after, worker_name: worker_name})
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: :failed, worker_name: worker_name}})
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
- ActiveRecord::Base.clear_active_connections! if defined?(ActiveRecord::Base)
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)
@@ -58,3 +58,6 @@ module RocketJob
58
58
  @rails = true
59
59
  end
60
60
  end
61
+
62
+ # Slice is a reserved word in Rails 7, but already being used in RocketJob long before that.
63
+ Mongoid.destructive_fields.delete(:slice) if Mongoid.respond_to?(:destructive_fields)
@@ -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: :queued}
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: :queued}
116
+ "$set" => {state: "queued"}
117
117
  )
118
118
  end
119
119
 
@@ -1,3 +1,3 @@
1
1
  module RocketJob
2
- VERSION = "6.2.0".freeze
2
+ VERSION = "6.3.0".freeze
3
3
  end
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.2.0
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-07-31 00:00:00.000000000 Z
11
+ date: 2023-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aasm