job-iteration 0.9.3 → 0.9.4

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
  SHA1:
3
- metadata.gz: ad408d4be3681757ec2dbe9c530938610f3802fd
4
- data.tar.gz: 9166829abfa92b0f552971a45ec7be86073664fe
3
+ metadata.gz: e1833eae2c053130cb1cb6729a33e0414683427d
4
+ data.tar.gz: 7fd2d0bb197fca5453de89efbc8881d8da9abcb3
5
5
  SHA512:
6
- metadata.gz: 1c2bf184cc6f7a643d0bd50de0d83b9eeb3f36998b97f05628a892bda4ad15234d45c8f369a5d9969239924821f98b19f55e2289f55dcf442d07a76ef84e3d5f
7
- data.tar.gz: 96f245daa9313d4adbde345cbc7bd298cf7ca9946bb481d5a98e8de0390293c584e0e6b4c2d8e5f1e126572b32780b60b43c938ae04c18e42cb0f19219fe0835
6
+ metadata.gz: 1793c72cc520206290d7d92be1970608d51afa0fab4f74d36c7c178d0523db5c1a282029481f08250635a8f1944c66d1fc37b6984e5128a1ca0d0bc7ae6e237e
7
+ data.tar.gz: f954ef4d69c5c7178dc97db6cc0e01b0ea9888d33757614e1c37f0b8f077457343470f977a95f6e17c41a01b96f5d66553255538e10a303f2661908e0a69cc0f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- job-iteration (0.9.3)
4
+ job-iteration (0.9.4)
5
5
  activejob (~> 5.2)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -181,7 +181,7 @@ This project would not be possible without these individuals (in alphabetical or
181
181
 
182
182
  ## Development
183
183
 
184
- After checking out the repo, run `bundle install` to install dependencies. Then, run `bundle exec rake test` to run the tests.
184
+ After checking out the repo, run `bin/setup` to install dependencies and create mysql database. Then, run `bundle exec rake test` to run the tests.
185
185
 
186
186
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
187
187
 
data/bin/setup ADDED
@@ -0,0 +1,23 @@
1
+ #!/bin/bash
2
+
3
+ if ! [ -x "$(command -v mysql)" ];
4
+ then
5
+ echo "Error: mysql is not installed." >&2
6
+ echo "You need to install mysql"
7
+ exit 1
8
+ else
9
+ echo "Installing dependencies"
10
+ bundle install --quiet
11
+
12
+ mysql.server start > /dev/null 2>&1
13
+ mysql -uroot job_iteration_test -e exit > /dev/null 2>&1
14
+
15
+ if [ $? -eq 0 ];
16
+ then
17
+ echo "Setup completed!"
18
+ else
19
+ echo "Creating job_iteration_test database"
20
+ mysql -uroot -e "CREATE DATABASE job_iteration_test" > /dev/null 2>&1
21
+ echo "Setup completed!"
22
+ fi
23
+ fi
@@ -144,11 +144,16 @@ module JobIteration
144
144
 
145
145
  self.already_in_queue = true if respond_to?(:already_in_queue=)
146
146
  run_callbacks :shutdown
147
- enqueue
147
+ retry_job unless @enqueued
148
148
 
149
149
  true
150
150
  end
151
151
 
152
+ def retry_job(*)
153
+ @enqueued = true
154
+ super
155
+ end
156
+
152
157
  def adjust_total_time
153
158
  self.total_time += (Time.now.utc.to_f - start_time.to_f).round(6)
154
159
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JobIteration
4
- VERSION = "0.9.3"
4
+ VERSION = "0.9.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: job-iteration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-09 00:00:00.000000000 Z
11
+ date: 2018-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob
@@ -83,6 +83,7 @@ files:
83
83
  - LICENSE.txt
84
84
  - README.md
85
85
  - Rakefile
86
+ - bin/setup
86
87
  - guides/best-practices.md
87
88
  - guides/custom-enumerator.md
88
89
  - guides/iteration-how-it-works.md