perfectsched 0.8.8 → 0.8.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +8 -0
- data/ChangeLog +4 -0
- data/README.md +2 -0
- data/lib/perfectsched.rb +3 -0
- data/lib/perfectsched/signal_queue.rb +1 -0
- data/lib/perfectsched/signal_thread.rb +25 -0
- data/lib/perfectsched/version.rb +1 -1
- data/lib/perfectsched/worker.rb +15 -14
- data/perfectsched.gemspec +1 -1
- data/spec/worker_spec.rb +7 -0
- metadata +31 -52
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c45e7a543642bacc55c6d17146aa817598c51395
|
4
|
+
data.tar.gz: c5c988003798ad2553dd30e34472af7dca6e79dc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d2dc9e2bb0f41d4c253cf55da6ff1100e84775ae8ed019a90b025a529257ce9e70efa14e179e91b0b0174f32055f7cef0fece33712d6dfdf5eb5e0571aa23950
|
7
|
+
data.tar.gz: 23b1f8d84cedb253bbc299c5a46fe26f98f22f489339f98e2f0bc3cebecdaf1b2c79f3b297b87bce365aa77ca088719f2a041544160a8a325f0143207bbb4dfb
|
data/.travis.yml
ADDED
data/ChangeLog
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# PerfectSched
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/treasure-data/perfectsched.svg?branch=master)](https://travis-ci.org/treasure-data/perfectsched)
|
4
|
+
|
3
5
|
PerfectSched is a highly available distributed cron built on top of RDBMS.
|
4
6
|
|
5
7
|
It provides at-least-once semantics; Even if a worker node fails during process a task, the task is retried by another worker.
|
data/lib/perfectsched.rb
CHANGED
@@ -35,7 +35,10 @@ module PerfectSched
|
|
35
35
|
:ScheduleWithMetadata => 'perfectsched/schedule',
|
36
36
|
:ScheduleMetadata => 'perfectsched/schedule_metadata',
|
37
37
|
:ScheduleMetadataAccessors => 'perfectsched/schedule_metadata',
|
38
|
+
# SignalQueue is obsolete because it does not run with ruby >= 2.0.0.
|
39
|
+
# See ddbf04c9 and use SignalThread instead.
|
38
40
|
:SignalQueue => 'perfectsched/signal_queue',
|
41
|
+
:SignalThread => 'perfectsched/signal_thread',
|
39
42
|
:Task => 'perfectsched/task',
|
40
43
|
:Worker => 'perfectsched/worker',
|
41
44
|
:VERSION => 'perfectsched/version',
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#
|
2
|
+
# PerfectSched
|
3
|
+
#
|
4
|
+
# Copyright (C) 2012 FURUHASHI Sadayuki
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
module PerfectSched
|
20
|
+
|
21
|
+
require 'perfectqueue/signal_thread'
|
22
|
+
SignalThread = PerfectQueue::SignalThread
|
23
|
+
|
24
|
+
end
|
25
|
+
|
data/lib/perfectsched/version.rb
CHANGED
data/lib/perfectsched/worker.rb
CHANGED
@@ -46,7 +46,7 @@ module PerfectSched
|
|
46
46
|
@engine.shutdown
|
47
47
|
end
|
48
48
|
ensure
|
49
|
-
@sig.
|
49
|
+
@sig.stop
|
50
50
|
end
|
51
51
|
return nil
|
52
52
|
rescue
|
@@ -130,28 +130,29 @@ module PerfectSched
|
|
130
130
|
end
|
131
131
|
|
132
132
|
def install_signal_handlers(&block)
|
133
|
-
|
134
|
-
|
135
|
-
|
133
|
+
s = self
|
134
|
+
SignalThread.new do |st|
|
135
|
+
st.trap :TERM do
|
136
|
+
s.stop
|
136
137
|
end
|
137
|
-
|
138
|
-
stop
|
138
|
+
st.trap :INT do
|
139
|
+
s.stop
|
139
140
|
end
|
140
141
|
|
141
|
-
|
142
|
-
stop
|
142
|
+
st.trap :QUIT do
|
143
|
+
s.stop
|
143
144
|
end
|
144
145
|
|
145
|
-
|
146
|
-
restart
|
146
|
+
st.trap :USR1 do
|
147
|
+
s.restart
|
147
148
|
end
|
148
149
|
|
149
|
-
|
150
|
-
restart
|
150
|
+
st.trap :HUP do
|
151
|
+
s.restart
|
151
152
|
end
|
152
153
|
|
153
|
-
|
154
|
-
logrotated
|
154
|
+
st.trap :USR2 do
|
155
|
+
s.logrotated
|
155
156
|
end
|
156
157
|
end
|
157
158
|
end
|
data/perfectsched.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.add_dependency "cron-spec", [">= 0.1.2", "<= 0.1.2"]
|
20
20
|
gem.add_dependency "sequel", "~> 3.48.0"
|
21
21
|
gem.add_dependency "tzinfo", "~> 0.3.29"
|
22
|
-
gem.add_dependency "perfectqueue", "~> 0.8.
|
22
|
+
gem.add_dependency "perfectqueue", "~> 0.8.41"
|
23
23
|
gem.add_development_dependency "rake", "~> 0.9.2"
|
24
24
|
gem.add_development_dependency "rspec", "~> 2.10.0"
|
25
25
|
gem.add_development_dependency "simplecov", "~> 0.5.4"
|
data/spec/worker_spec.rb
CHANGED
metadata
CHANGED
@@ -1,148 +1,131 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: perfectsched
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
5
|
-
prerelease:
|
4
|
+
version: 0.8.9
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Sadayuki Furuhashi
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-06-03 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: cron-spec
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 0.1.2
|
22
|
-
- - <=
|
20
|
+
- - "<="
|
23
21
|
- !ruby/object:Gem::Version
|
24
22
|
version: 0.1.2
|
25
23
|
type: :runtime
|
26
24
|
prerelease: false
|
27
25
|
version_requirements: !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
29
26
|
requirements:
|
30
|
-
- -
|
27
|
+
- - ">="
|
31
28
|
- !ruby/object:Gem::Version
|
32
29
|
version: 0.1.2
|
33
|
-
- - <=
|
30
|
+
- - "<="
|
34
31
|
- !ruby/object:Gem::Version
|
35
32
|
version: 0.1.2
|
36
33
|
- !ruby/object:Gem::Dependency
|
37
34
|
name: sequel
|
38
35
|
requirement: !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
36
|
requirements:
|
41
|
-
- - ~>
|
37
|
+
- - "~>"
|
42
38
|
- !ruby/object:Gem::Version
|
43
39
|
version: 3.48.0
|
44
40
|
type: :runtime
|
45
41
|
prerelease: false
|
46
42
|
version_requirements: !ruby/object:Gem::Requirement
|
47
|
-
none: false
|
48
43
|
requirements:
|
49
|
-
- - ~>
|
44
|
+
- - "~>"
|
50
45
|
- !ruby/object:Gem::Version
|
51
46
|
version: 3.48.0
|
52
47
|
- !ruby/object:Gem::Dependency
|
53
48
|
name: tzinfo
|
54
49
|
requirement: !ruby/object:Gem::Requirement
|
55
|
-
none: false
|
56
50
|
requirements:
|
57
|
-
- - ~>
|
51
|
+
- - "~>"
|
58
52
|
- !ruby/object:Gem::Version
|
59
53
|
version: 0.3.29
|
60
54
|
type: :runtime
|
61
55
|
prerelease: false
|
62
56
|
version_requirements: !ruby/object:Gem::Requirement
|
63
|
-
none: false
|
64
57
|
requirements:
|
65
|
-
- - ~>
|
58
|
+
- - "~>"
|
66
59
|
- !ruby/object:Gem::Version
|
67
60
|
version: 0.3.29
|
68
61
|
- !ruby/object:Gem::Dependency
|
69
62
|
name: perfectqueue
|
70
63
|
requirement: !ruby/object:Gem::Requirement
|
71
|
-
none: false
|
72
64
|
requirements:
|
73
|
-
- - ~>
|
65
|
+
- - "~>"
|
74
66
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.8.
|
67
|
+
version: 0.8.41
|
76
68
|
type: :runtime
|
77
69
|
prerelease: false
|
78
70
|
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
none: false
|
80
71
|
requirements:
|
81
|
-
- - ~>
|
72
|
+
- - "~>"
|
82
73
|
- !ruby/object:Gem::Version
|
83
|
-
version: 0.8.
|
74
|
+
version: 0.8.41
|
84
75
|
- !ruby/object:Gem::Dependency
|
85
76
|
name: rake
|
86
77
|
requirement: !ruby/object:Gem::Requirement
|
87
|
-
none: false
|
88
78
|
requirements:
|
89
|
-
- - ~>
|
79
|
+
- - "~>"
|
90
80
|
- !ruby/object:Gem::Version
|
91
81
|
version: 0.9.2
|
92
82
|
type: :development
|
93
83
|
prerelease: false
|
94
84
|
version_requirements: !ruby/object:Gem::Requirement
|
95
|
-
none: false
|
96
85
|
requirements:
|
97
|
-
- - ~>
|
86
|
+
- - "~>"
|
98
87
|
- !ruby/object:Gem::Version
|
99
88
|
version: 0.9.2
|
100
89
|
- !ruby/object:Gem::Dependency
|
101
90
|
name: rspec
|
102
91
|
requirement: !ruby/object:Gem::Requirement
|
103
|
-
none: false
|
104
92
|
requirements:
|
105
|
-
- - ~>
|
93
|
+
- - "~>"
|
106
94
|
- !ruby/object:Gem::Version
|
107
95
|
version: 2.10.0
|
108
96
|
type: :development
|
109
97
|
prerelease: false
|
110
98
|
version_requirements: !ruby/object:Gem::Requirement
|
111
|
-
none: false
|
112
99
|
requirements:
|
113
|
-
- - ~>
|
100
|
+
- - "~>"
|
114
101
|
- !ruby/object:Gem::Version
|
115
102
|
version: 2.10.0
|
116
103
|
- !ruby/object:Gem::Dependency
|
117
104
|
name: simplecov
|
118
105
|
requirement: !ruby/object:Gem::Requirement
|
119
|
-
none: false
|
120
106
|
requirements:
|
121
|
-
- - ~>
|
107
|
+
- - "~>"
|
122
108
|
- !ruby/object:Gem::Version
|
123
109
|
version: 0.5.4
|
124
110
|
type: :development
|
125
111
|
prerelease: false
|
126
112
|
version_requirements: !ruby/object:Gem::Requirement
|
127
|
-
none: false
|
128
113
|
requirements:
|
129
|
-
- - ~>
|
114
|
+
- - "~>"
|
130
115
|
- !ruby/object:Gem::Version
|
131
116
|
version: 0.5.4
|
132
117
|
- !ruby/object:Gem::Dependency
|
133
118
|
name: sqlite3
|
134
119
|
requirement: !ruby/object:Gem::Requirement
|
135
|
-
none: false
|
136
120
|
requirements:
|
137
|
-
- - ~>
|
121
|
+
- - "~>"
|
138
122
|
- !ruby/object:Gem::Version
|
139
123
|
version: 1.3.3
|
140
124
|
type: :development
|
141
125
|
prerelease: false
|
142
126
|
version_requirements: !ruby/object:Gem::Requirement
|
143
|
-
none: false
|
144
127
|
requirements:
|
145
|
-
- - ~>
|
128
|
+
- - "~>"
|
146
129
|
- !ruby/object:Gem::Version
|
147
130
|
version: 1.3.3
|
148
131
|
description: Highly available distributed cron built on RDBMS
|
@@ -152,7 +135,8 @@ executables:
|
|
152
135
|
extensions: []
|
153
136
|
extra_rdoc_files: []
|
154
137
|
files:
|
155
|
-
- .gitignore
|
138
|
+
- ".gitignore"
|
139
|
+
- ".travis.yml"
|
156
140
|
- ChangeLog
|
157
141
|
- Gemfile
|
158
142
|
- README.md
|
@@ -178,6 +162,7 @@ files:
|
|
178
162
|
- lib/perfectsched/schedule_collection.rb
|
179
163
|
- lib/perfectsched/schedule_metadata.rb
|
180
164
|
- lib/perfectsched/signal_queue.rb
|
165
|
+
- lib/perfectsched/signal_thread.rb
|
181
166
|
- lib/perfectsched/task.rb
|
182
167
|
- lib/perfectsched/version.rb
|
183
168
|
- lib/perfectsched/worker.rb
|
@@ -188,36 +173,30 @@ files:
|
|
188
173
|
- spec/worker_spec.rb
|
189
174
|
homepage: https://github.com/treasure-data/perfectsched
|
190
175
|
licenses: []
|
176
|
+
metadata: {}
|
191
177
|
post_install_message:
|
192
178
|
rdoc_options: []
|
193
179
|
require_paths:
|
194
180
|
- lib
|
195
181
|
required_ruby_version: !ruby/object:Gem::Requirement
|
196
|
-
none: false
|
197
182
|
requirements:
|
198
|
-
- -
|
183
|
+
- - ">="
|
199
184
|
- !ruby/object:Gem::Version
|
200
185
|
version: '0'
|
201
|
-
segments:
|
202
|
-
- 0
|
203
|
-
hash: -336495823616886649
|
204
186
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
205
|
-
none: false
|
206
187
|
requirements:
|
207
|
-
- -
|
188
|
+
- - ">="
|
208
189
|
- !ruby/object:Gem::Version
|
209
190
|
version: '0'
|
210
|
-
segments:
|
211
|
-
- 0
|
212
|
-
hash: -336495823616886649
|
213
191
|
requirements: []
|
214
192
|
rubyforge_project:
|
215
|
-
rubygems_version:
|
193
|
+
rubygems_version: 2.4.5
|
216
194
|
signing_key:
|
217
|
-
specification_version:
|
195
|
+
specification_version: 4
|
218
196
|
summary: Highly available distributed cron built on RDBMS
|
219
197
|
test_files:
|
220
198
|
- spec/rdb_compat_backend_spec.rb
|
221
199
|
- spec/schedule_collection_spec.rb
|
222
200
|
- spec/spec_helper.rb
|
223
201
|
- spec/worker_spec.rb
|
202
|
+
has_rdoc: false
|