Add an uptime endpoint for Pingdom.
Sends a simple database query to see if we can still connect to the database. Should help us detect issues like yesterday's EC2 issues earlier.
This commit is contained in:
parent
c7c33ed2aa
commit
618241a458
16
lib/travis/api/app/endpoint/uptime.rb
Normal file
16
lib/travis/api/app/endpoint/uptime.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
require 'travis/api/app'
|
||||
|
||||
class Travis::Api::App
|
||||
class Endpoint
|
||||
class Uptime < Endpoint
|
||||
get '/' do
|
||||
begin
|
||||
ActiveRecord::Base.connection.execute('select 1')
|
||||
[200, "OK"]
|
||||
rescue => e
|
||||
[500, "Error: #{e.message}"]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user