inst-jobs 3.1.13 → 3.1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/delayed/backend/active_record.rb +14 -1
- data/lib/delayed/message_sending.rb +1 -1
- data/lib/delayed/version.rb +1 -1
- metadata +6 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16e359eba573f46a29762f1afd4bb55a52fcc9252f25ff61779f7f9b136d8f92
|
4
|
+
data.tar.gz: 2983f7040757c9421ae2464c79599556cd0286678ada618787c9fbe5019eca34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8296ac3fe9c675ed42f02ad7a112534d30bf212f57ca288313615eb2fa2954f114cd1a5c0f20ca886a11a6ed8085bed5c21d355f63ddadb52ba3508a341cc47
|
7
|
+
data.tar.gz: 65c2307f632d2dd2360fa0dc97c2c5fa373185c9c1fb78b7c057e970166a25742faa0a294bc8382cee895fc96c3d6302e7af6dbeb2bc44f99bbfff9f792edcd8
|
@@ -25,6 +25,8 @@ module Delayed
|
|
25
25
|
include Delayed::Backend::Base
|
26
26
|
self.table_name = :delayed_jobs
|
27
27
|
|
28
|
+
attr_accessor :enqueue_result
|
29
|
+
|
28
30
|
scope :next_in_strand_order, -> { order(:strand_order_override, :id) }
|
29
31
|
|
30
32
|
def self.reconnect!
|
@@ -106,7 +108,8 @@ module Delayed
|
|
106
108
|
end
|
107
109
|
|
108
110
|
# https://www.postgresql.org/docs/9.5/libpq-exec.html
|
109
|
-
|
111
|
+
# https://stackoverflow.com/questions/39058213/differentiate-inserted-and-updated-rows-in-upsert-using-system-columns
|
112
|
+
sql << " RETURNING id, (xmax = 0) AS inserted"
|
110
113
|
|
111
114
|
if lock_and_insert
|
112
115
|
# > Multiple queries sent in a single PQexec call are processed in a single transaction,
|
@@ -120,12 +123,22 @@ module Delayed
|
|
120
123
|
end
|
121
124
|
result = connection.execute(sql, "#{self.class} Create")
|
122
125
|
self.id = result.values.first&.first
|
126
|
+
inserted = result.values.first&.second
|
123
127
|
result.clear
|
124
128
|
else
|
125
129
|
result = connection.exec_query(sql, "#{self.class} Create", binds)
|
126
130
|
self.id = connection.send(:last_inserted_id, result)
|
131
|
+
inserted = result.rows.first&.second
|
127
132
|
end
|
128
133
|
|
134
|
+
self.enqueue_result = if id.present? && inserted
|
135
|
+
:inserted
|
136
|
+
elsif id.present? && !inserted
|
137
|
+
:updated
|
138
|
+
else
|
139
|
+
:dropped
|
140
|
+
end
|
141
|
+
|
129
142
|
# it might not get set if there was an existing record, and we didn't update it
|
130
143
|
if id
|
131
144
|
@new_record = false
|
@@ -94,7 +94,7 @@ module Delayed
|
|
94
94
|
def __calculate_sender_for_delay
|
95
95
|
# enforce public send in dev and test, but not prod (since it uses
|
96
96
|
# debug APIs, it's expensive)
|
97
|
-
|
97
|
+
sender(1) if ::Rails.env.test? || ::Rails.env.development?
|
98
98
|
end
|
99
99
|
|
100
100
|
module ClassMethods
|
data/lib/delayed/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inst-jobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Cutrer
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-
|
13
|
+
date: 2023-11-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
@@ -116,20 +116,6 @@ dependencies:
|
|
116
116
|
- - ">="
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '6.0'
|
119
|
-
- !ruby/object:Gem::Dependency
|
120
|
-
name: appraisal
|
121
|
-
requirement: !ruby/object:Gem::Requirement
|
122
|
-
requirements:
|
123
|
-
- - "~>"
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '2.4'
|
126
|
-
type: :development
|
127
|
-
prerelease: false
|
128
|
-
version_requirements: !ruby/object:Gem::Requirement
|
129
|
-
requirements:
|
130
|
-
- - "~>"
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
version: '2.4'
|
133
119
|
- !ruby/object:Gem::Dependency
|
134
120
|
name: bump
|
135
121
|
requirement: !ruby/object:Gem::Requirement
|
@@ -242,20 +228,6 @@ dependencies:
|
|
242
228
|
- - ">="
|
243
229
|
- !ruby/object:Gem::Version
|
244
230
|
version: '0'
|
245
|
-
- !ruby/object:Gem::Dependency
|
246
|
-
name: rails
|
247
|
-
requirement: !ruby/object:Gem::Requirement
|
248
|
-
requirements:
|
249
|
-
- - ">="
|
250
|
-
- !ruby/object:Gem::Version
|
251
|
-
version: '0'
|
252
|
-
type: :development
|
253
|
-
prerelease: false
|
254
|
-
version_requirements: !ruby/object:Gem::Requirement
|
255
|
-
requirements:
|
256
|
-
- - ">="
|
257
|
-
- !ruby/object:Gem::Version
|
258
|
-
version: '0'
|
259
231
|
- !ruby/object:Gem::Dependency
|
260
232
|
name: rake
|
261
233
|
requirement: !ruby/object:Gem::Requirement
|
@@ -372,16 +344,16 @@ dependencies:
|
|
372
344
|
name: timecop
|
373
345
|
requirement: !ruby/object:Gem::Requirement
|
374
346
|
requirements:
|
375
|
-
- -
|
347
|
+
- - "~>"
|
376
348
|
- !ruby/object:Gem::Version
|
377
|
-
version: 0.9
|
349
|
+
version: '0.9'
|
378
350
|
type: :development
|
379
351
|
prerelease: false
|
380
352
|
version_requirements: !ruby/object:Gem::Requirement
|
381
353
|
requirements:
|
382
|
-
- -
|
354
|
+
- - "~>"
|
383
355
|
- !ruby/object:Gem::Version
|
384
|
-
version: 0.9
|
356
|
+
version: '0.9'
|
385
357
|
- !ruby/object:Gem::Dependency
|
386
358
|
name: webmock
|
387
359
|
requirement: !ruby/object:Gem::Requirement
|