cron_helper 0.1.1 → 0.1.2
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/README.md +15 -2
- data/lib/cron_helper/job.rb +1 -1
- data/lib/cron_helper/version.rb +1 -1
- 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: 5ad71ac9b1e0eba052393b6d409d93fa2897c4c2
|
4
|
+
data.tar.gz: 9c54b7da97fb794a2945c33d6da3c5efb3d93ea5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af20cfff02647a8ac93cf66cc40856a674359d9645fc346a21fe88d10c2f5658652c1de9e2c7305782f31f6afebd88916e5d07be24e10c6c9931f6cd08b55762
|
7
|
+
data.tar.gz: 310249043eeb0ea50df02be23871c3d4c453dd236f22bde9205e45ca021f5ee10b9ea4e853dd6aad59c4d61c747efbe9af375b20895b44c839b881a754116af9
|
data/README.md
CHANGED
@@ -61,7 +61,7 @@ class HourlyJob < ApplicationJob
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
```
|
64
|
-
Finally you will schedule your jobs using the [Whenever](https://github.com/javan/whenever
|
64
|
+
Finally you will schedule your jobs using the [Whenever](https://github.com/javan/whenever) gem.
|
65
65
|
Below is an example config/schedule.rb that also forces your jobs to run at a low priority.
|
66
66
|
Running jobs at a low priority is recommended when your server has other roles (web, app, db, etc).
|
67
67
|
|
@@ -69,7 +69,7 @@ Running jobs at a low priority is recommended when your server has other roles (
|
|
69
69
|
job_type :runner, "cd :path && nice -n 20 script/rails runner -e :environment ':task' :output"
|
70
70
|
|
71
71
|
every 1.hour do
|
72
|
-
runner('
|
72
|
+
runner('HourlyJob.new.run')
|
73
73
|
end
|
74
74
|
```
|
75
75
|
|
@@ -79,6 +79,19 @@ Tasks are guaranteed to run in the order you register them.
|
|
79
79
|
They are also guaranteed to run even if a previous task encountered an exception.
|
80
80
|
This gives you control over creating new tasks without having to worry about breaking old ones.
|
81
81
|
|
82
|
+
## Customization
|
83
|
+
You can customize where stdout/stderr are sent to by overriding the ````output_handler```` method.
|
84
|
+
Normally you will want to put this in ```ApplicationJob```.
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
class ApplicationJob < CronHelper::Job
|
88
|
+
private
|
89
|
+
output_handler(output)
|
90
|
+
# Log the output to your custom destination (email, DB, SMS alerts, etc).
|
91
|
+
end
|
92
|
+
end
|
93
|
+
```
|
94
|
+
|
82
95
|
## Development
|
83
96
|
|
84
97
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/cron_helper/job.rb
CHANGED
data/lib/cron_helper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cron_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chad Remesch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|