job-iteration 0.9.6 → 0.9.7
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.
Potentially problematic release.
This version of job-iteration might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.rubocop.yml +7 -0
- data/.travis.yml +4 -0
- data/CHANGELOG.md +11 -0
- data/Gemfile +0 -1
- data/Gemfile.lock +3 -3
- data/Rakefile +1 -1
- data/gemfiles/activejob_5_2.gemfile +5 -0
- data/gemfiles/activejob_edge.gemfile +6 -0
- data/job-iteration.gemspec +8 -5
- data/lib/job-iteration/csv_enumerator.rb +1 -1
- data/lib/job-iteration/iteration.rb +7 -7
- data/lib/job-iteration/version.rb +1 -1
- metadata +24 -6
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 | 
            -
             | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 2 | 
            +
            SHA256:
         | 
| 3 | 
            +
              metadata.gz: ffc9f695ffad79aa7c097581241e0da79c0e7da09e0ab45094135720ac751b84
         | 
| 4 | 
            +
              data.tar.gz: 1804b93cec0989965f43bb6dcefd62a46873878605ad6e6918c0d6305f69e016
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 0a58d74621a3f94bdcb22c2cbc097c4700f8ade5cf4b20b7b3307ae802c43f888276b63b85b633cf8e40116432a1f9c8d1c9adee363c355abf86142a8385d3ba
         | 
| 7 | 
            +
              data.tar.gz: ef8e11855bdafba6ec0c35da341775fd14c4caeb2a708f35f5c2f7f04d14ed4f93d5595e07b65d5e47ef08a492f4ffaa30145f5f5968e1ae8feab3bd609ff4ab
         | 
    
        data/.rubocop.yml
    CHANGED
    
    
    
        data/.travis.yml
    CHANGED
    
    
    
        data/CHANGELOG.md
    ADDED
    
    
    
        data/Gemfile
    CHANGED
    
    
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/Rakefile
    CHANGED
    
    
    
        data/job-iteration.gemspec
    CHANGED
    
    | @@ -15,16 +15,19 @@ Gem::Specification.new do |spec| | |
| 15 15 | 
             
              spec.homepage      = "https://github.com/shopify/job-iteration"
         | 
| 16 16 | 
             
              spec.license       = "MIT"
         | 
| 17 17 |  | 
| 18 | 
            -
              spec.files         =  | 
| 18 | 
            +
              spec.files         = %x(git ls-files -z).split("\x0").reject do |f|
         | 
| 19 19 | 
             
                f.match(%r{^(test|spec|features)/})
         | 
| 20 20 | 
             
              end
         | 
| 21 21 | 
             
              spec.bindir        = "exe"
         | 
| 22 22 | 
             
              spec.executables   = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
         | 
| 23 23 | 
             
              spec.require_paths = %w(lib)
         | 
| 24 24 |  | 
| 25 | 
            -
              spec. | 
| 25 | 
            +
              spec.metadata["changelog_uri"] = "https://github.com/Shopify/job-iteration/blob/master/CHANGELOG.md"
         | 
| 26 26 |  | 
| 27 | 
            -
              spec. | 
| 28 | 
            -
             | 
| 29 | 
            -
              spec.add_development_dependency | 
| 27 | 
            +
              spec.add_dependency("activejob", ">= 5.2")
         | 
| 28 | 
            +
             | 
| 29 | 
            +
              spec.add_development_dependency("bundler", "~> 1.16")
         | 
| 30 | 
            +
              spec.add_development_dependency("rake", "~> 10.0")
         | 
| 31 | 
            +
              spec.add_development_dependency("minitest", "~> 5.0")
         | 
| 32 | 
            +
              spec.add_development_dependency("activerecord")
         | 
| 30 33 | 
             
            end
         | 
| @@ -94,15 +94,15 @@ module JobIteration | |
| 94 94 | 
             
                  end
         | 
| 95 95 |  | 
| 96 96 | 
             
                  unless enumerator
         | 
| 97 | 
            -
                    logger.info | 
| 98 | 
            -
                      "Skipping the job."
         | 
| 97 | 
            +
                    logger.info("[JobIteration::Iteration] `build_enumerator` returned nil. " \
         | 
| 98 | 
            +
                      "Skipping the job.")
         | 
| 99 99 | 
             
                    return
         | 
| 100 100 | 
             
                  end
         | 
| 101 101 |  | 
| 102 102 | 
             
                  assert_enumerator!(enumerator)
         | 
| 103 103 |  | 
| 104 104 | 
             
                  if executions == 1 && times_interrupted == 0
         | 
| 105 | 
            -
                    run_callbacks | 
| 105 | 
            +
                    run_callbacks(:start)
         | 
| 106 106 | 
             
                  else
         | 
| 107 107 | 
             
                    ActiveSupport::Notifications.instrument("resumed.iteration", iteration_instrumentation_tags)
         | 
| 108 108 | 
             
                  end
         | 
| @@ -111,10 +111,10 @@ module JobIteration | |
| 111 111 | 
             
                    iterate_with_enumerator(enumerator, arguments)
         | 
| 112 112 | 
             
                  end
         | 
| 113 113 |  | 
| 114 | 
            -
                  run_callbacks | 
| 114 | 
            +
                  run_callbacks(:shutdown)
         | 
| 115 115 |  | 
| 116 116 | 
             
                  if run_complete_callbacks?(completed)
         | 
| 117 | 
            -
                    run_callbacks | 
| 117 | 
            +
                    run_callbacks(:complete)
         | 
| 118 118 | 
             
                    output_interrupt_summary
         | 
| 119 119 | 
             
                  end
         | 
| 120 120 | 
             
                end
         | 
| @@ -144,7 +144,7 @@ module JobIteration | |
| 144 144 |  | 
| 145 145 | 
             
                def reenqueue_iteration_job
         | 
| 146 146 | 
             
                  ActiveSupport::Notifications.instrument("interrupted.iteration", iteration_instrumentation_tags)
         | 
| 147 | 
            -
                  logger.info | 
| 147 | 
            +
                  logger.info("[JobIteration::Iteration] Interrupting and re-enqueueing the job cursor_position=#{cursor_position}")
         | 
| 148 148 |  | 
| 149 149 | 
             
                  adjust_total_time
         | 
| 150 150 | 
             
                  self.times_interrupted += 1
         | 
| @@ -194,7 +194,7 @@ module JobIteration | |
| 194 194 | 
             
                  adjust_total_time
         | 
| 195 195 |  | 
| 196 196 | 
             
                  message = "[JobIteration::Iteration] Completed iterating. times_interrupted=%d total_time=%.3f"
         | 
| 197 | 
            -
                  logger.info | 
| 197 | 
            +
                  logger.info(Kernel.format(message, times_interrupted, total_time))
         | 
| 198 198 | 
             
                end
         | 
| 199 199 |  | 
| 200 200 | 
             
                def job_should_exit?
         | 
    
        metadata
    CHANGED
    
    | @@ -1,27 +1,27 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: job-iteration
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.9. | 
| 4 | 
            +
              version: 0.9.7
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Shopify
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2018-11- | 
| 11 | 
            +
            date: 2018-11-30 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activejob
         | 
| 15 15 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 16 | 
             
                requirements:
         | 
| 17 | 
            -
                - - " | 
| 17 | 
            +
                - - ">="
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 19 | 
             
                    version: '5.2'
         | 
| 20 20 | 
             
              type: :runtime
         | 
| 21 21 | 
             
              prerelease: false
         | 
| 22 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 23 | 
             
                requirements:
         | 
| 24 | 
            -
                - - " | 
| 24 | 
            +
                - - ">="
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 26 | 
             
                    version: '5.2'
         | 
| 27 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| @@ -66,6 +66,20 @@ dependencies: | |
| 66 66 | 
             
                - - "~>"
         | 
| 67 67 | 
             
                  - !ruby/object:Gem::Version
         | 
| 68 68 | 
             
                    version: '5.0'
         | 
| 69 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 70 | 
            +
              name: activerecord
         | 
| 71 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 | 
            +
                requirements:
         | 
| 73 | 
            +
                - - ">="
         | 
| 74 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 75 | 
            +
                    version: '0'
         | 
| 76 | 
            +
              type: :development
         | 
| 77 | 
            +
              prerelease: false
         | 
| 78 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 | 
            +
                requirements:
         | 
| 80 | 
            +
                - - ">="
         | 
| 81 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 82 | 
            +
                    version: '0'
         | 
| 69 83 | 
             
            description: Makes your background jobs interruptible and resumable.
         | 
| 70 84 | 
             
            email:
         | 
| 71 85 | 
             
            - ops-accounts+shipit@shopify.com
         | 
| @@ -77,6 +91,7 @@ files: | |
| 77 91 | 
             
            - ".rubocop.yml"
         | 
| 78 92 | 
             
            - ".travis.yml"
         | 
| 79 93 | 
             
            - ".yardopts"
         | 
| 94 | 
            +
            - CHANGELOG.md
         | 
| 80 95 | 
             
            - CODE_OF_CONDUCT.md
         | 
| 81 96 | 
             
            - Gemfile
         | 
| 82 97 | 
             
            - Gemfile.lock
         | 
| @@ -85,6 +100,8 @@ files: | |
| 85 100 | 
             
            - Rakefile
         | 
| 86 101 | 
             
            - bin/setup
         | 
| 87 102 | 
             
            - dev.yml
         | 
| 103 | 
            +
            - gemfiles/activejob_5_2.gemfile
         | 
| 104 | 
            +
            - gemfiles/activejob_edge.gemfile
         | 
| 88 105 | 
             
            - guides/best-practices.md
         | 
| 89 106 | 
             
            - guides/custom-enumerator.md
         | 
| 90 107 | 
             
            - guides/iteration-how-it-works.md
         | 
| @@ -103,7 +120,8 @@ files: | |
| 103 120 | 
             
            homepage: https://github.com/shopify/job-iteration
         | 
| 104 121 | 
             
            licenses:
         | 
| 105 122 | 
             
            - MIT
         | 
| 106 | 
            -
            metadata: | 
| 123 | 
            +
            metadata:
         | 
| 124 | 
            +
              changelog_uri: https://github.com/Shopify/job-iteration/blob/master/CHANGELOG.md
         | 
| 107 125 | 
             
            post_install_message: 
         | 
| 108 126 | 
             
            rdoc_options: []
         | 
| 109 127 | 
             
            require_paths:
         | 
| @@ -120,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 120 138 | 
             
                  version: '0'
         | 
| 121 139 | 
             
            requirements: []
         | 
| 122 140 | 
             
            rubyforge_project: 
         | 
| 123 | 
            -
            rubygems_version: 2.6 | 
| 141 | 
            +
            rubygems_version: 2.7.6
         | 
| 124 142 | 
             
            signing_key: 
         | 
| 125 143 | 
             
            specification_version: 4
         | 
| 126 144 | 
             
            summary: Makes your background jobs interruptible and resumable.
         |