job-iteration 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/bin/setup +23 -0
- data/lib/job-iteration/iteration.rb +6 -1
- data/lib/job-iteration/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1833eae2c053130cb1cb6729a33e0414683427d
|
4
|
+
data.tar.gz: 7fd2d0bb197fca5453de89efbc8881d8da9abcb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1793c72cc520206290d7d92be1970608d51afa0fab4f74d36c7c178d0523db5c1a282029481f08250635a8f1944c66d1fc37b6984e5128a1ca0d0bc7ae6e237e
|
7
|
+
data.tar.gz: f954ef4d69c5c7178dc97db6cc0e01b0ea9888d33757614e1c37f0b8f077457343470f977a95f6e17c41a01b96f5d66553255538e10a303f2661908e0a69cc0f
|
data/Gemfile.lock
CHANGED
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 `
|
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
|
-
|
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
|
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.
|
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-
|
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
|