Skip to content

Commit

Permalink
added support shutdown_message. Not useful yet but used in testserver
Browse files Browse the repository at this point in the history
  • Loading branch information
rmax committed Mar 8, 2010
1 parent 4e13a10 commit 4af2c1d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions myproject/tornadoweb/management/commands/runtornado.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def handle(self, addrport='', *args, **options):
raise CommandError("%r is not a valid port number." % port)

use_reloader = options.get('use_reloader', False)
shutdown_message = options.get('shutdown_message', '')
quit_command = (sys.platform == 'win32') and 'CTRL-BREAK' or 'CONTROL-C'

def inner_run():
Expand Down Expand Up @@ -70,6 +71,8 @@ def inner_run():

ioloop.IOLoop.instance().start()
except KeyboardInterrupt:
if shutdown_message:
print shutdown_message
sys.exit(0)

if use_reloader:
Expand Down

0 comments on commit 4af2c1d

Please sign in to comment.