skiplock 1.1.1 → 1.1.3
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/skiplock/job.rb +5 -5
- data/lib/skiplock/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: 20d942af62acf618cbb7d7baeaf3d2f0404aac8cf012c255c8806ddbe5d23fd9
         | 
| 4 | 
            +
              data.tar.gz: 7383cfaf4f4a15b0cb9fe8a55bca896b72bcb3c728684aa4e60cc876be67d97e
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 487fc69ce0ff35ed020c2c0d0823303743d86afd1acd9a18d2399602afcb34f15e1f8215a10f65fafdcf10f9a3982fe8c76cb2df3043dff5ee6562f2379dfd03
         | 
| 7 | 
            +
              data.tar.gz: e71774849db02070c6690d76818f22d693dc7531d3e9ca09710a8768359bdda857edf734f0f86d386e03098d1c66991aae6c7d4b91c2398b7135dc9dc4f25980
         | 
    
        data/lib/skiplock/job.rb
    CHANGED
    
    | @@ -27,9 +27,9 @@ module Skiplock | |
| 27 27 | 
             
                  timestamp = Time.at(timestamp) if timestamp
         | 
| 28 28 | 
             
                  if Thread.current[:skiplock_job].try(:id) == activejob.job_id
         | 
| 29 29 | 
             
                    Thread.current[:skiplock_job].activejob_error = options[:error]
         | 
| 30 | 
            -
                    Thread.current[:skiplock_job].data['activejob_error'] = true
         | 
| 31 30 | 
             
                    Thread.current[:skiplock_job].executions = activejob.executions
         | 
| 32 31 | 
             
                    Thread.current[:skiplock_job].exception_executions = activejob.exception_executions
         | 
| 32 | 
            +
                    Thread.current[:skiplock_job].exception_executions['activejob_error'] = true
         | 
| 33 33 | 
             
                    Thread.current[:skiplock_job].scheduled_at = timestamp
         | 
| 34 34 | 
             
                    Thread.current[:skiplock_job]
         | 
| 35 35 | 
             
                  else
         | 
| @@ -65,8 +65,8 @@ module Skiplock | |
| 65 65 | 
             
                  self.worker_id = nil
         | 
| 66 66 | 
             
                  self.updated_at = Time.now > self.updated_at ? Time.now : self.updated_at + 1 # in case of clock drifting
         | 
| 67 67 | 
             
                  if self.exception
         | 
| 68 | 
            -
                    self.exception_executions["[#{self.exception.class.name}]"] = self.exception_executions["[#{self.exception.class.name}]"].to_i + 1 unless self. | 
| 69 | 
            -
                    if (self.executions.to_i >= self.max_retries + 1) || self. | 
| 68 | 
            +
                    self.exception_executions["[#{self.exception.class.name}]"] = self.exception_executions["[#{self.exception.class.name}]"].to_i + 1 unless self.exception_executions.key?('activejob_error')
         | 
| 69 | 
            +
                    if (self.executions.to_i >= self.max_retries + 1) || self.exception_executions.key?('activejob_error') || self.exception.is_a?(Skiplock::Extension::ProxyError)
         | 
| 70 70 | 
             
                      self.expired_at = Time.now
         | 
| 71 71 | 
             
                    else
         | 
| 72 72 | 
             
                      self.scheduled_at = Time.now + (5 * 2**self.executions.to_i)
         | 
| @@ -116,7 +116,7 @@ module Skiplock | |
| 116 116 | 
             
                  self.max_retries = (self.data['options'].key?('max_retries') ? self.data['options']['max_retries'].to_i : max_retries) rescue max_retries
         | 
| 117 117 | 
             
                  self.max_retries = 20 if self.max_retries < 0 || self.max_retries > 20
         | 
| 118 118 | 
             
                  self.purge = (self.data['options'].key?('purge') ? self.data['options']['purge'] : purge_completion) rescue purge_completion
         | 
| 119 | 
            -
                  job_data = self. | 
| 119 | 
            +
                  job_data = { 'job_class' => self.job_class, 'queue_name' => self.queue_name, 'locale' => self.locale, 'timezone' => self.timezone, 'priority' => self.priority, 'executions' => self.executions, 'exception_executions' => self.exception_executions.dup, 'job_id' => self.id, 'enqueued_at' => self.updated_at, 'arguments' => (self.data['arguments'] || []) }
         | 
| 120 120 | 
             
                  self.executions = self.executions.to_i + 1
         | 
| 121 121 | 
             
                  Thread.current[:skiplock_job] = self
         | 
| 122 122 | 
             
                  start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
         | 
| @@ -149,4 +149,4 @@ module Skiplock | |
| 149 149 | 
             
                  self.dispose
         | 
| 150 150 | 
             
                end
         | 
| 151 151 | 
             
              end
         | 
| 152 | 
            -
            end
         | 
| 152 | 
            +
            end
         | 
    
        data/lib/skiplock/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: skiplock
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.1. | 
| 4 | 
            +
              version: 1.1.3
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Tin Vo
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2022-09- | 
| 11 | 
            +
            date: 2022-09-15 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activejob
         |