summaryrefslogtreecommitdiff
path: root/lib/task.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2012-03-12 14:27:08 +0100
committerChristoph Helma <helma@in-silico.ch>2012-03-12 14:27:08 +0100
commit9cf20c9fa99bac82c8a4e455eb6c97ecb3f26776 (patch)
treee97abf097700bbc79651e3981ce8f89786039a49 /lib/task.rb
parenta6d8cafba8142e9020a388f0b48366c3d0d40d72 (diff)
actor uri added
Diffstat (limited to 'lib/task.rb')
-rw-r--r--lib/task.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/task.rb b/lib/task.rb
index 0562dc7..3f1b691 100644
--- a/lib/task.rb
+++ b/lib/task.rb
@@ -1,4 +1,3 @@
-require File.join(File.dirname(__FILE__),'error')
DEFAULT_TASK_MAX_DURATION = 36000
module OpenTox
@@ -9,7 +8,6 @@ module OpenTox
def self.create service_uri, params={}
- # TODO set/enforce request uri
# TODO: run observer in same process?
task = Task.new RestClientWrapper.post(service_uri,params).chomp
pid = fork do
@@ -19,7 +17,6 @@ module OpenTox
rescue
RestClientWrapper.put(File.join(task.uri,'Error'),{:errorReport => $!.report.to_yaml})
task.kill
- #raise $!
end
end
Process.detach(pid)
@@ -43,7 +40,7 @@ module OpenTox
def kill
Process.kill(9,@pid)
Process.kill(9,@observer_pid)
- rescue # no need to raise an exeption if processes are not running
+ rescue # no need to raise an exeption if processes are not running
end
def description
@@ -91,6 +88,8 @@ module OpenTox
RestClientWrapper.head(@uri).code == 200
end
+ # TODO: add queued?
+
def error?
code = RestClientWrapper.head(@uri).code
code >= 400 and code != 503