active_job_status 1.2.0 → 1.2.1
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/CHANGELOG.md +4 -1
- data/lib/active_job_status/job_batch.rb +2 -2
- data/lib/active_job_status/version.rb +1 -1
- data/spec/job_batch_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84db9cd64e705477457dc8a26e5eb933feafc0db
|
4
|
+
data.tar.gz: f9d888e8d8bdfff969f85fa00a8c461053ee9fdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 071d38cda3a6c6d94ba193f2e0e838a13b989633b229fd2c0fecb11b4b04e8c260a963ee88ca747096a1f3aea286b4831b29f25886f3a2ee20b68a6efd122aa8
|
7
|
+
data.tar.gz: 5bc2c62021717551fa696a5bf5db14a6e1826b2617cca1d262674dddc46402b403fa9770fcde807e68e251bb783d156e5a368cbfade6f18efcfd8d667be0b64b
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
# ActiveJobStatus
|
2
|
+
## 1.2.1
|
3
|
+
- Fixes bug with JobBatch#completed? (https://github.com/cdale77/active_job_status/pull/19)
|
4
|
+
|
2
5
|
## 1.2.0
|
3
6
|
- Add support for Rails 5
|
4
7
|
- Adds many small improvements (see https://github.com/cdale77/active_job_status/pull/15)
|
@@ -8,7 +11,7 @@
|
|
8
11
|
|
9
12
|
## 1.0.0
|
10
13
|
- Move TrackableJob inside ActiveJobStatus namespace. Bump version to 1.0.0, as
|
11
|
-
this may be a breaking change for some users.
|
14
|
+
this may be a breaking change for some users.
|
12
15
|
|
13
16
|
## 0.0.5
|
14
17
|
- Use ActiveSupport::Cache instead of Redis, reducing dependencies. Changes
|
@@ -34,9 +34,9 @@ module ActiveJobStatus
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def completed?
|
37
|
-
|
37
|
+
!@job_ids.map do |job_id|
|
38
38
|
job_status = ActiveJobStatus.get_status(job_id)
|
39
|
-
job_status
|
39
|
+
job_status != nil && job_status != :completed
|
40
40
|
end.any?
|
41
41
|
end
|
42
42
|
|
data/spec/job_batch_spec.rb
CHANGED
@@ -57,6 +57,11 @@ describe ActiveJobStatus::JobBatch do
|
|
57
57
|
update_store(id_array: total_jobs, job_status: :working)
|
58
58
|
expect(batch.completed?).to be_falsey
|
59
59
|
end
|
60
|
+
it "should be false with mixed jobs status of working and completed" do
|
61
|
+
update_store_mixed_status(id_array: total_jobs,
|
62
|
+
job_status_array: [:working, :completed])
|
63
|
+
expect(batch.completed?).to be_falsey
|
64
|
+
end
|
60
65
|
it "should be true when jobs are all completed" do
|
61
66
|
update_store(id_array: total_jobs, job_status: :completed)
|
62
67
|
expect(batch.completed?).to be_truthy
|
@@ -109,6 +114,13 @@ describe ActiveJobStatus::JobBatch do
|
|
109
114
|
end
|
110
115
|
end
|
111
116
|
|
117
|
+
def update_store_mixed_status(id_array: [], job_status_array: [:queued])
|
118
|
+
n_element = job_status_array.count
|
119
|
+
id_array.each_with_index do |id, index|
|
120
|
+
store.write(id, job_status_array[index % n_element].to_s)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
112
124
|
def clear_store(id_array: [])
|
113
125
|
id_array.each do |id|
|
114
126
|
store.delete(id)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_job_status
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brad Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|