inst-jobs 3.1.9 → 3.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b84071f5e26623586c13f855f5ce616786a61fa18ebae0a4640cfd48ab2a63c
4
- data.tar.gz: c2c386ac0864c1ac08173eb4960ccdf1f7b89184799c59f7d1b427b4330c548d
3
+ metadata.gz: 372437f25842f762a361453b2846ff561868f4f1783e91b090f2dfc40a8b22f6
4
+ data.tar.gz: '091128e8391c5acf7f12263887af7f79a7253ed721c39978cd1e1a3fbd93157c'
5
5
  SHA512:
6
- metadata.gz: 898a6eb496ec26e653ba3a360cd1e820aaba1a04b3768a265976b5d3ed9150e38795f25fdb1adfb89c69f930ec6bb92d2388e36685685abac0209c1e534e2f36
7
- data.tar.gz: 26c8af5d1a05624a0ffd161f8d49fa5c81a205f974849577a0d7fa9c84735c48e0269d7078a038fb2e9865aeae294378b12656c0d5359c3d80bbc31429acf0b7
6
+ metadata.gz: 17b6e974d17be8d6ccc6d7f01f2747789b37e48461c862666542957fb299cda415c9aecda8885110254c5d0b7ad45768f6f82c6d85856ab430717a0db89a0db5
7
+ data.tar.gz: 6e093a601037c58be6d04d96c9b2965099a084285cc7ce80908dfaad1e6515ddd007172b96d2e6e8e3d8f9702d7af4bd5dca82041fa362887ae3d170aed4c5ca
@@ -231,8 +231,7 @@ module Delayed
231
231
  # Uses an exponential scale depending on the number of failed attempts.
232
232
  def reschedule(error = nil, time = nil)
233
233
  begin
234
- obj = payload_object
235
- return_code = obj.on_failure(error) if obj.respond_to?(:on_failure)
234
+ return_code = invoke_payload_object_cb(:on_failure, error)
236
235
  rescue
237
236
  # don't allow a failed deserialization to prevent rescheduling
238
237
  end
@@ -254,8 +253,7 @@ module Delayed
254
253
  def permanent_failure(error)
255
254
  begin
256
255
  # notify the payload_object of a permanent failure
257
- obj = payload_object
258
- obj.on_permanent_failure(error) if obj.respond_to?(:on_permanent_failure)
256
+ invoke_payload_object_cb(:on_permanent_failure, error)
259
257
  rescue
260
258
  # don't allow a failed deserialization to prevent destroying the job
261
259
  end
@@ -410,6 +408,11 @@ module Delayed
410
408
  md[1].constantize
411
409
  end
412
410
 
411
+ def invoke_payload_object_cb(method, ...)
412
+ obj = payload_object
413
+ obj.public_send(method, ...) if obj.respond_to?(method)
414
+ end
415
+
413
416
  public
414
417
 
415
418
  def initialize_defaults
@@ -21,6 +21,8 @@ module Delayed
21
21
  self.permanent_fail_cb = on_permanent_failure
22
22
  self.sender_is_object = sender.equal?(object)
23
23
  self.sender_is_class = sender.is_a?(object.class)
24
+ # bypass visibility checks (see MessageSending#__calculate_sender_for_delay)
25
+ self.sender_is_object = true if sender.nil?
24
26
  end
25
27
 
26
28
  def display_name
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Delayed
4
- VERSION = "3.1.9"
4
+ VERSION = "3.1.11"
5
5
  end
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.9
4
+ version: 3.1.11
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-05-03 00:00:00.000000000 Z
13
+ date: 2023-08-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord