cron_helper 0.1.2 → 0.2.0
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 +1 -1
- data/lib/cron_helper/job.rb +4 -4
- 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: f84ceea071dc51e881d6c1599c56f500b9f95aa2
|
4
|
+
data.tar.gz: 6dd2ca97148bfa21f16be3e7de46c86286b0e3b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1e14993c7fb2ab2fe949300daf4ad3b99bf62e9561078ad6b1c635dfb2b1f159c2daa435d2d057ce5b1425955e7cc60778b9542bf3231a5d8df830e1e756601
|
7
|
+
data.tar.gz: 468b2bd30a602089db0d81cf0fb55ddfdb6ac1c4773d7dffef38c169f165a136404e5041e46d0216c429a277c7534c88b3aa5d91406061b7a3df4a77f2a47cd9
|
data/README.md
CHANGED
@@ -86,7 +86,7 @@ Normally you will want to put this in ```ApplicationJob```.
|
|
86
86
|
```ruby
|
87
87
|
class ApplicationJob < CronHelper::Job
|
88
88
|
private
|
89
|
-
output_handler(output)
|
89
|
+
def output_handler(output)
|
90
90
|
# Log the output to your custom destination (email, DB, SMS alerts, etc).
|
91
91
|
end
|
92
92
|
end
|
data/lib/cron_helper/job.rb
CHANGED
@@ -70,21 +70,21 @@ module CronHelper
|
|
70
70
|
|
71
71
|
File.open(lock_file_path, File::RDWR|File::CREAT, 0644) do |f|
|
72
72
|
unless f.flock(File::LOCK_EX|File::LOCK_NB)
|
73
|
-
puts "
|
73
|
+
puts "CRON_HELPER FAILED TO LOCK (#{job_name} at #{Time.zone.now})"
|
74
74
|
return
|
75
75
|
end
|
76
76
|
|
77
77
|
begin
|
78
78
|
yield
|
79
79
|
rescue Exception => e
|
80
|
-
puts "
|
80
|
+
puts "CRON_HELPER EXCEPTION (#{job_name} at #{Time.zone.now}): #{e.message}\n#{e.backtrace}"
|
81
81
|
ensure
|
82
82
|
f.flock(File::LOCK_UN)
|
83
83
|
end
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
|
-
def
|
87
|
+
def job_name
|
88
88
|
return self.class.to_s
|
89
89
|
end
|
90
90
|
|
@@ -93,7 +93,7 @@ module CronHelper
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def lock_file_name
|
96
|
-
return "#{
|
96
|
+
return "#{job_name}.lock"
|
97
97
|
end
|
98
98
|
|
99
99
|
def lock_file_path
|
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.
|
4
|
+
version: 0.2.0
|
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-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|