simple_scheduler 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -1
- data/lib/simple_scheduler/future_job.rb +7 -0
- data/lib/simple_scheduler/version.rb +1 -1
- data/lib/tasks/simple_scheduler_tasks.rake +8 -0
- metadata +39 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a609cbea37bbbcfc43aa830039a3b89ab2467bf9
|
4
|
+
data.tar.gz: a4bafa4c6c324a4dd75e0b5b4cb49076a4313d40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5eb15d2033392fb29a3305bd81485fe940a673f55583e0aaaa0c5bf0f029c52570c80c399ca05ffc5f94d9820144f62f8fa245fd02a76ae4087846f66a7802f
|
7
|
+
data.tar.gz: 8a5807630dc3881df1810a299540f67226c81a6973556972f7944b50c906b9b42790168c0593ce3bb385214db414d8ee41664a8559ca486985531dfea50f7dc4
|
data/README.md
CHANGED
@@ -133,7 +133,7 @@ If your worker process is down for an extended period of time, you may not want
|
|
133
133
|
to execute when the server comes back online. The `expires_after` value will be used
|
134
134
|
to determine if it's too late to run the job at the actual run time.
|
135
135
|
|
136
|
-
All jobs are scheduled in the future using the `
|
136
|
+
All jobs are scheduled in the future using the `SimpleScheduler::FutureJob`. This
|
137
137
|
wrapper job does the work of evaluating the current time and determining if the
|
138
138
|
scheduled job should run. See [Handling Expired Jobs](#handling-expired-jobs).
|
139
139
|
|
@@ -183,6 +183,31 @@ SimpleScheduler.expired_task do |exception|
|
|
183
183
|
end
|
184
184
|
```
|
185
185
|
|
186
|
+
## Making Changes to Configuration File
|
187
|
+
|
188
|
+
Any changes made to the YAML configuration file will be picked up by Simple Scheduler
|
189
|
+
the next time `rake simple_scheduler` is run. Depending on the changes, you may need
|
190
|
+
to reset the current job queue.
|
191
|
+
|
192
|
+
Reasons you may need to reset the job queue:
|
193
|
+
|
194
|
+
- Renaming a job's class
|
195
|
+
- Deleting a scheduled task
|
196
|
+
- Changing the task's run time interval
|
197
|
+
- Changing the day of the week the job is run
|
198
|
+
|
199
|
+
A rake task exists to delete all existing scheduled jobs and queue them back up from scratch:
|
200
|
+
|
201
|
+
```
|
202
|
+
rake simple_scheduler:reset
|
203
|
+
```
|
204
|
+
|
205
|
+
If you're using a custom configuration file:
|
206
|
+
|
207
|
+
```
|
208
|
+
rake simple_scheduler:reset["config/simple_scheduler.staging.yml"]
|
209
|
+
```
|
210
|
+
|
186
211
|
## How It Works
|
187
212
|
|
188
213
|
The Heroku Scheduler must be set up to run `rake simple_scheduler` every 10 minutes.
|
@@ -26,6 +26,13 @@ module SimpleScheduler
|
|
26
26
|
queue_task
|
27
27
|
end
|
28
28
|
|
29
|
+
# Delete all future jobs created by Simple Scheduler from the `Sidekiq::ScheduledSet`.
|
30
|
+
def self.delete_all
|
31
|
+
Task.scheduled_set.each do |job|
|
32
|
+
job.delete if job.display_class == "SimpleScheduler::FutureJob"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
29
36
|
private
|
30
37
|
|
31
38
|
# The duration between the scheduled run time and actual run time that
|
@@ -2,3 +2,11 @@ desc "Queue future jobs defined using Simple Scheduler"
|
|
2
2
|
task :simple_scheduler, [:config_path] => [:environment] do |_, args|
|
3
3
|
SimpleScheduler::SchedulerJob.perform_now(args[:config_path])
|
4
4
|
end
|
5
|
+
|
6
|
+
namespace :simple_scheduler do
|
7
|
+
desc "Delete existing scheduled jobs and queue them from scratch"
|
8
|
+
task :reset, [:config_path] => [:environment] do |_, args|
|
9
|
+
SimpleScheduler::FutureJob.delete_all
|
10
|
+
SimpleScheduler::SchedulerJob.perform_now(args[:config_path])
|
11
|
+
end
|
12
|
+
end
|
metadata
CHANGED
@@ -1,125 +1,139 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_scheduler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Pattison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '4.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: '4.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sidekiq
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '4.2'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '4.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: appraisal
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: codeclimate-test-reporter
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rainbow
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.1.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.1.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: rspec-rails
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- -
|
87
|
+
- - ">="
|
74
88
|
- !ruby/object:Gem::Version
|
75
89
|
version: '0'
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- -
|
94
|
+
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: rubocop
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
|
-
- -
|
101
|
+
- - ">="
|
88
102
|
- !ruby/object:Gem::Version
|
89
103
|
version: '0'
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
|
-
- -
|
108
|
+
- - ">="
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: simplecov
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
|
-
- -
|
115
|
+
- - ">="
|
102
116
|
- !ruby/object:Gem::Version
|
103
117
|
version: '0'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
|
-
- -
|
122
|
+
- - ">="
|
109
123
|
- !ruby/object:Gem::Version
|
110
124
|
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: simplecov-rcov
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
|
-
- -
|
129
|
+
- - ">="
|
116
130
|
- !ruby/object:Gem::Version
|
117
131
|
version: '0'
|
118
132
|
type: :development
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
|
-
- -
|
136
|
+
- - ">="
|
123
137
|
- !ruby/object:Gem::Version
|
124
138
|
version: '0'
|
125
139
|
description: |2
|
@@ -132,17 +146,17 @@ executables: []
|
|
132
146
|
extensions: []
|
133
147
|
extra_rdoc_files: []
|
134
148
|
files:
|
149
|
+
- MIT-LICENSE
|
150
|
+
- README.md
|
151
|
+
- Rakefile
|
152
|
+
- lib/simple_scheduler.rb
|
135
153
|
- lib/simple_scheduler/at.rb
|
136
154
|
- lib/simple_scheduler/future_job.rb
|
137
155
|
- lib/simple_scheduler/railtie.rb
|
138
156
|
- lib/simple_scheduler/scheduler_job.rb
|
139
157
|
- lib/simple_scheduler/task.rb
|
140
158
|
- lib/simple_scheduler/version.rb
|
141
|
-
- lib/simple_scheduler.rb
|
142
159
|
- lib/tasks/simple_scheduler_tasks.rake
|
143
|
-
- MIT-LICENSE
|
144
|
-
- Rakefile
|
145
|
-
- README.md
|
146
160
|
homepage: https://github.com/simplymadeapps/simple_scheduler
|
147
161
|
licenses:
|
148
162
|
- MIT
|
@@ -153,17 +167,17 @@ require_paths:
|
|
153
167
|
- lib
|
154
168
|
required_ruby_version: !ruby/object:Gem::Requirement
|
155
169
|
requirements:
|
156
|
-
- -
|
170
|
+
- - ">="
|
157
171
|
- !ruby/object:Gem::Version
|
158
172
|
version: '0'
|
159
173
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
174
|
requirements:
|
161
|
-
- -
|
175
|
+
- - ">="
|
162
176
|
- !ruby/object:Gem::Version
|
163
177
|
version: '0'
|
164
178
|
requirements: []
|
165
179
|
rubyforge_project:
|
166
|
-
rubygems_version: 2.
|
180
|
+
rubygems_version: 2.5.1
|
167
181
|
signing_key:
|
168
182
|
specification_version: 4
|
169
183
|
summary: An enhancement for Heroku Scheduler + Sidekiq for scheduling jobs at specific
|