lib/cloud_crowd/app.rb in documentcloud-cloud-crowd-0.0.3 vs lib/cloud_crowd/app.rb in documentcloud-cloud-crowd-0.0.4
- old
+ new
@@ -1,17 +1,18 @@
module CloudCrowd
class App < Sinatra::Default
-
- # static serves files from /public, methodoverride allows the _method param.
- enable :static, :methodoverride
- set :root, CloudCrowd::ROOT
+ set :root, ROOT
set :authorization_realm, "CloudCrowd"
- helpers CloudCrowd::Helpers
+ helpers Helpers
+ # static serves files from /public, methodoverride allows the _method param.
+ enable :static, :methodoverride
+
+ # Enabling HTTP Authentication turns it on for all requests.
before do
login_required if CloudCrowd.config[:use_http_authentication]
end
# Start a new job. Accepts a JSON representation of the job-to-be.
@@ -49,10 +50,10 @@
dequeue_work_unit
when 'failed'
current_work_unit.fail(params[:output], params[:time])
dequeue_work_unit(1)
else
- return error(500, "Completing a work unit must specify status.")
+ error(500, "Completing a work unit must specify status.")
end
end
end
# To monitor the central server with Monit, God, Nagios, or another
\ No newline at end of file