sevenwire-bj 1.0.2 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +4 -1
- data/bj.gemspec +1 -1
- data/lib/bj.rb +1 -1
- data/lib/bj/runner.rb +5 -5
- data/lib/bj/table.rb +1 -1
- data/lib/bj/util.rb +4 -0
- metadata +1 -1
data/HISTORY
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.4:
|
2
|
+
- added config["utc"] to convert times from local to utc (by Brandon Arbini)
|
3
|
+
|
4
|
+
1.0.3:
|
2
5
|
- env wasn't properly unpacked by runner, added YAML.load(job.env), thanks
|
3
6
|
Chris Wanstrath
|
4
7
|
- made operations that generate migrations, etc, verbose - they dump
|
data/bj.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "bj"
|
3
|
-
s.version = "1.0.
|
3
|
+
s.version = "1.0.4"
|
4
4
|
s.summary = "Bj"
|
5
5
|
|
6
6
|
s.files = ["bin", "bin/bj", "bj.gemspec", "HISTORY", "install.rb", "lib", "lib/bj", "lib/bj/api.rb", "lib/bj/attributes.rb", "lib/bj/bj.rb", "lib/bj/errors.rb", "lib/bj/joblist.rb", "lib/bj/logger.rb", "lib/bj/runner.rb", "lib/bj/stdext.rb", "lib/bj/table.rb", "lib/bj/util.rb", "lib/bj.rb", "rakefile", "README", "TODO"]
|
data/lib/bj.rb
CHANGED
@@ -3,7 +3,7 @@ unless defined? Bj
|
|
3
3
|
#
|
4
4
|
# constants and associated attrs
|
5
5
|
#
|
6
|
-
Bj::VERSION = "1.0.
|
6
|
+
Bj::VERSION = "1.0.4" #unless defined?(Bj::VERSION)
|
7
7
|
def self.version() Bj::VERSION end
|
8
8
|
|
9
9
|
Bj::LIBDIR = File.expand_path(File::join(File.dirname(__FILE__), "bj")) + File::SEPARATOR unless
|
data/lib/bj/runner.rb
CHANGED
@@ -185,7 +185,7 @@ class Bj
|
|
185
185
|
job = thread = stdout = stderr = nil
|
186
186
|
|
187
187
|
Bj.transaction(options) do
|
188
|
-
now =
|
188
|
+
now = Util.now
|
189
189
|
|
190
190
|
job = Bj::Table::Job.find :first,
|
191
191
|
:conditions => ["state = ? and submitted_at <= ?", "pending", now],
|
@@ -202,7 +202,7 @@ class Bj
|
|
202
202
|
stdin = job.stdin || ''
|
203
203
|
stdout = job.stdout || ''
|
204
204
|
stderr = job.stderr || ''
|
205
|
-
started_at =
|
205
|
+
started_at = Util.now
|
206
206
|
|
207
207
|
thread = Util.start command, :cwd=>Bj.rails_root, :env=>env, :stdin=>stdin, :stdout=>stdout, :stderr=>stderr
|
208
208
|
|
@@ -215,7 +215,7 @@ class Bj
|
|
215
215
|
end
|
216
216
|
|
217
217
|
exit_status = thread.value
|
218
|
-
finished_at =
|
218
|
+
finished_at = Util.now
|
219
219
|
|
220
220
|
Bj.transaction(options) do
|
221
221
|
job = Bj::Table::Job.find job.id
|
@@ -289,7 +289,7 @@ class Bj
|
|
289
289
|
|
290
290
|
def fill_morgue
|
291
291
|
Bj.transaction do
|
292
|
-
now =
|
292
|
+
now = Util.now
|
293
293
|
jobs = Bj::Table::Job.find :all,
|
294
294
|
:conditions => ["state = 'running' and runner = ?", Bj.hostname]
|
295
295
|
jobs.each do |job|
|
@@ -311,7 +311,7 @@ class Bj
|
|
311
311
|
|
312
312
|
def archive_jobs
|
313
313
|
Bj.transaction do
|
314
|
-
now =
|
314
|
+
now = Util.now
|
315
315
|
too_old = now - Bj.ttl
|
316
316
|
jobs = Bj::Table::Job.find :all,
|
317
317
|
:conditions => ["(state = 'finished' or state = 'dead') and submitted_at < ?", too_old]
|
data/lib/bj/table.rb
CHANGED
data/lib/bj/util.rb
CHANGED