perfectsched 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +8 -2
- data/lib/perfectsched/backend/simpledb.rb +1 -2
- data/lib/perfectsched/command/perfectsched.rb +19 -16
- data/lib/perfectsched/version.rb +1 -1
- metadata +4 -4
data/ChangeLog
CHANGED
@@ -103,7 +103,7 @@ begin
|
|
103
103
|
type ||= :run
|
104
104
|
|
105
105
|
case type
|
106
|
-
|
106
|
+
when :add
|
107
107
|
if ARGV.length != 2
|
108
108
|
usage nil
|
109
109
|
end
|
@@ -184,7 +184,7 @@ conf[:timeout] ||= 60
|
|
184
184
|
conf[:poll_interval] ||= 1
|
185
185
|
|
186
186
|
# backend
|
187
|
-
bconf =
|
187
|
+
bconf = conf[:backend]
|
188
188
|
if domain = bconf['simpledb']
|
189
189
|
require 'perfectsched/backend/simpledb'
|
190
190
|
key_id = bconf['aws_key_id'] || ENV['AWS_ACCESS_KEY_ID']
|
@@ -205,21 +205,23 @@ else
|
|
205
205
|
end
|
206
206
|
|
207
207
|
# queue
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
208
|
+
make_queue = Proc.new do
|
209
|
+
bconf = conf[:queue]
|
210
|
+
if domain = bconf['simpledb']
|
211
|
+
require 'perfectqueue/backend/simpledb'
|
212
|
+
key_id = bconf['aws_key_id'] || ENV['AWS_ACCESS_KEY_ID']
|
213
|
+
secret_key = bconf['aws_secret_key'] || ENV['AWS_SECRET_ACCESS_KEY']
|
214
|
+
queue = PerfectQueue::SimpleDBBackend.new(key_id, secret_key, domain)
|
215
|
+
|
216
|
+
elsif uri = bconf['database']
|
217
|
+
require 'perfectqueue/backend/rdb'
|
218
|
+
table = bconf['table'] || "perfectqueue"
|
219
|
+
queue = PerfectQueue::RDBBackend.new(uri, table)
|
219
220
|
|
220
|
-
else
|
221
|
-
|
222
|
-
|
221
|
+
else
|
222
|
+
$stderr.puts "Invalid configuration file: queue section is required"
|
223
|
+
exit 1
|
224
|
+
end
|
223
225
|
end
|
224
226
|
|
225
227
|
require 'logger'
|
@@ -313,6 +315,7 @@ when :run
|
|
313
315
|
log.level = Logger::INFO
|
314
316
|
end
|
315
317
|
|
318
|
+
queue = make_queue.call
|
316
319
|
engine = PerfectSched::Engine.new(backend, queue, log, conf)
|
317
320
|
|
318
321
|
trap :INT do
|
data/lib/perfectsched/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: perfectsched
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 1
|
10
|
+
version: 0.7.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sadayuki Furuhashi
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-09-
|
18
|
+
date: 2011-09-16 00:00:00 +09:00
|
19
19
|
default_executable: perfectsched
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|