Skip to content

Commit

Permalink
Remove unused /health/shutdown command.
Browse files Browse the repository at this point in the history
  • Loading branch information
spladug committed Jan 10, 2012
1 parent 706b27b commit 9a6c436
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
1 change: 0 additions & 1 deletion r2/r2/config/routing.py
Expand Up @@ -148,7 +148,6 @@ def make_map(global_conf={}, app_conf={}):
mc('/health', controller='health', action='health')
mc('/health/:action', controller='health',
requirements=dict(action="threads|dump|sleep"))
mc('/shutdown', controller='health', action='shutdown')

mc('/', controller='hot', action='listing')

Expand Down
21 changes: 2 additions & 19 deletions r2/r2/controllers/health.py
Expand Up @@ -22,12 +22,8 @@ def pre(self):

def GET_health(self):
c.dontcache = True

if g.shutdown:
abort(503, 'service temporarily unavailable')
else:
response.headers['Content-Type'] = 'text/plain'
return "i'm still alive!"
response.headers['Content-Type'] = 'text/plain'
return "i'm still alive!"

@validate(secret=nop('secret'))
def GET_sleep(self, secret):
Expand Down Expand Up @@ -81,16 +77,3 @@ def GET_dump(self, secret):

response.headers['Content-Type'] = 'text/plain'
return output or 'no busy threads'

@validate(secret=nop('secret'))
def GET_shutdown(self, secret):
if not g.shutdown_secret:
self.abort404()
if not secret or secret != g.shutdown_secret:
self.abort403()

c.dontcache = True
#the will make the next health-check initiate the shutdown
g.shutdown = 'init'
response.headers['Content-Type'] = 'text/plain'
return 'shutting down...'
3 changes: 0 additions & 3 deletions r2/r2/lib/app_globals.py
Expand Up @@ -358,9 +358,6 @@ def reset_caches():
self.log.debug("Overriding g.%s to %s" % (k, v))
setattr(self, k, v)

#the shutdown toggle
self.shutdown = False

#if we're going to use the query_queue, we need amqp
if self.write_query_queue and not self.amqp_host:
raise Exception("amqp_host must be defined to use the query queue")
Expand Down

0 comments on commit 9a6c436

Please sign in to comment.