scheduled_job 0.0.5 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.md +2 -0
- data/lib/scheduled_job/version.rb +1 -1
- data/lib/scheduled_job.rb +1 -1
- data/spec/lib/scheduled_job_spec.rb +9 -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: c8ea6abcb1b9b801216f8a3e27a91dae479d9377
|
4
|
+
data.tar.gz: 32fb82a6c7ffa8c36a4be849b7740b5137f4b88f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 412e75f034b7ebf325bd2b85dd5b4930f0f6487f50b19ff41f96a71d127f2cd84ca2b0ceb0d4cdccb959630450eaa3518faf7d44efe9d364badbd259fbd1ebcc
|
7
|
+
data.tar.gz: a864639f37994c9d72f2d952ffd6da4e7fdbb91876281779a8ed7f80d78fbb9cbb7e6a86e4e45637368960b33536fee2811c361f92ca35535556f8a9fc3fc27a
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1.
|
1
|
+
2.1.5
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# ScheduledJob
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/rightscale/scheduled_job.svg?branch=master)](https://travis-ci.org/rightscale/scheduled_job)
|
4
|
+
|
3
5
|
Scheduled job looks to build on top of the [delayed_job](https://github.com/collectiveidea/delayed_job) project by adding support for jobs that need to recur. Whilst investigating other options we decided that we wanted a very light weight framework that would simply allow us to define worker tasks that need to happen on a regular basis.
|
4
6
|
|
5
7
|
In order to achieve this we created the following interface which allows the developer to consisly define what the job is to do as well as when it is to run. This helps keep all the logic in one place which is a huge plus.
|
data/lib/scheduled_job.rb
CHANGED
@@ -78,7 +78,7 @@ module ScheduledJob
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def job_exists?(job = nil)
|
81
|
-
conditions = ['handler like ? AND failed_at IS NULL', "
|
81
|
+
conditions = ['handler like ? AND failed_at IS NULL', "%:#{self.name} %"]
|
82
82
|
unless job.blank?
|
83
83
|
conditions[0] << " AND id != ?"
|
84
84
|
conditions << job.id
|
@@ -16,6 +16,9 @@ class UnderTest
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
class Test < UnderTest
|
20
|
+
end
|
21
|
+
|
19
22
|
describe ScheduledJob do
|
20
23
|
|
21
24
|
let(:under_test) { UnderTest.new }
|
@@ -123,6 +126,12 @@ describe ScheduledJob do
|
|
123
126
|
UnderTest.schedule_job job
|
124
127
|
end
|
125
128
|
|
129
|
+
pending 'doesnt find substring jobs as existing' do
|
130
|
+
UnderTest.schedule_job
|
131
|
+
Test.schedule_job
|
132
|
+
expect(Delayed::Job.count).to eq(2)
|
133
|
+
end
|
134
|
+
|
126
135
|
it "scheduled a job even if there is total failure and an existing job" do
|
127
136
|
dummy_job = double("job")
|
128
137
|
allow(dummy_job).to receive(:id)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scheduled_job
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CallumD
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2015-01-28 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: delayed_job
|