clockwork_web 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of clockwork_web might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +7 -3
- data/clockwork_web.gemspec +1 -1
- data/lib/clockwork_web.rb +5 -7
- data/lib/clockwork_web/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b6682772e7c4324485934c82c4c4acef12ca804
|
4
|
+
data.tar.gz: a4092bbb63449d3a68a9fe406e8e66afffc7039a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 020f78ff5439cbd78ce11fe6dbae6d47d38f34dd281765bc179671a3a5408ece6c262f6d849aa908c92eb9d1fa3fa49aed2d57743e3a0b204de404001ee1596d
|
7
|
+
data.tar.gz: 7a24d4074534c8af29668596219f22bad41cf53321e08cb9a0b402b4cc1acc7a98cbd4ad15f625305d9a8d492226d911737ddf0a91ec14bdf5a0fda106e93249
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -4,12 +4,12 @@ A web interface for Clockwork
|
|
4
4
|
|
5
5
|
[View the demo](https://clockwork-web.herokuapp.com/)
|
6
6
|
|
7
|
-
[screenshot goes here]
|
8
|
-
|
9
7
|
- see list of jobs
|
10
8
|
- monitor jobs
|
11
9
|
- disable jobs
|
12
10
|
|
11
|
+
:tangerine: Battle-tested at [Instacart](https://www.instacart.com)
|
12
|
+
|
13
13
|
## Installation
|
14
14
|
|
15
15
|
Add this line to your application’s Gemfile:
|
@@ -26,7 +26,7 @@ mount ClockworkWeb::Engine, at: "clockwork"
|
|
26
26
|
|
27
27
|
Be sure to secure the dashboard in production.
|
28
28
|
|
29
|
-
To
|
29
|
+
To monitor and disable jobs, hook up Redis in an initializer.
|
30
30
|
|
31
31
|
```ruby
|
32
32
|
ClockworkWeb.redis = Redis.new
|
@@ -74,6 +74,10 @@ ClockworkWeb.monitor = false
|
|
74
74
|
|
75
75
|
- better design
|
76
76
|
|
77
|
+
## History
|
78
|
+
|
79
|
+
View the [changelog](CHANGELOG.md)
|
80
|
+
|
77
81
|
## Contributing
|
78
82
|
|
79
83
|
Everyone is encouraged to help improve this project. Here are a few ways you can help:
|
data/clockwork_web.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_dependency "clockwork"
|
22
|
-
spec.add_dependency "
|
22
|
+
spec.add_dependency "safely_block"
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.7"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
data/lib/clockwork_web.rb
CHANGED
@@ -2,7 +2,7 @@ require "clockwork_web/version"
|
|
2
2
|
|
3
3
|
# dependencies
|
4
4
|
require "clockwork"
|
5
|
-
require "
|
5
|
+
require "safely_block"
|
6
6
|
|
7
7
|
# engine
|
8
8
|
require "clockwork_web/engine"
|
@@ -11,6 +11,7 @@ module ClockworkWeb
|
|
11
11
|
LAST_RUNS_KEY = "clockwork:last_runs"
|
12
12
|
DISABLED_KEY = "clockwork:disabled"
|
13
13
|
HEARTBEAT_KEY = "clockwork:heartbeat"
|
14
|
+
STATUS_KEY = "clockwork:status"
|
14
15
|
|
15
16
|
class << self
|
16
17
|
attr_accessor :clock_path
|
@@ -81,11 +82,8 @@ module ClockworkWeb
|
|
81
82
|
heartbeat = Time.now.to_i
|
82
83
|
if heartbeat % 10 == 0
|
83
84
|
prev_heartbeat = redis.getset(HEARTBEAT_KEY, heartbeat).to_i
|
84
|
-
if
|
85
|
-
|
86
|
-
# TODO try to surface hostnames when this condition is detected
|
87
|
-
# TODO hook to take action
|
88
|
-
redis.setex("clockwork:status", 20, "multiple")
|
85
|
+
if prev_heartbeat >= heartbeat
|
86
|
+
redis.setex(STATUS_KEY, 60, "multiple")
|
89
87
|
end
|
90
88
|
end
|
91
89
|
end
|
@@ -96,7 +94,7 @@ module ClockworkWeb
|
|
96
94
|
end
|
97
95
|
|
98
96
|
def self.multiple?
|
99
|
-
redis && redis.get(
|
97
|
+
redis && redis.get(STATUS_KEY) == "multiple"
|
100
98
|
end
|
101
99
|
end
|
102
100
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clockwork_web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clockwork
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: safely_block
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -74,6 +74,7 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- ".gitignore"
|
77
|
+
- CHANGELOG.md
|
77
78
|
- Gemfile
|
78
79
|
- LICENSE.txt
|
79
80
|
- README.md
|
@@ -111,3 +112,4 @@ signing_key:
|
|
111
112
|
specification_version: 4
|
112
113
|
summary: A web interface for Clockwork
|
113
114
|
test_files: []
|
115
|
+
has_rdoc:
|