Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
sadielbartholomew committed Feb 26, 2019
1 parent 90bb4a7 commit ba2faba
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/python/rosie/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __init__(self, *args, **kwargs):
super(
RosieDiscoServiceApplication, self).__init__(handlers, **settings)

def signal_handler(self, signum, frame):
def sigint_handler(self, signum, frame):
self.stopping = True

def stop_application(self):
Expand Down Expand Up @@ -318,21 +318,18 @@ def main():
info_msg_end = " the server providing the Rosie Disco web application."
if options.start:

signal.signal(signal.SIGINT, app.signal_handler)
signal.signal(signal.SIGTERM, app.signal_handler)
signal.signal(signal.SIGINT, app.sigint_handler)
signal.signal(signal.SIGTERM, app.sigint_handler)
app.listen(options.port)

tornado.ioloop.PeriodicCallback(app.stop_application, 5).start()
tornado.ioloop.PeriodicCallback(app.stop_application, 5000).start()
tornado.ioloop.IOLoop.instance().start()
#signal.pause()

print("Started" + info_msg_end)
elif options.stop and (options.non_interactive or
input("Stop server? y/n (default=n)") == "y"):
#app.stop_application()
app.stopping = True
#app.stop_application()

### SEND SIGNAL HERE - FINAL BIY YAAY
pass
print("Stopped" + info_msg_end) ## OR NOT, STILL DEBUGGING ...

app = RosieDiscoServiceApplication()
Expand Down

0 comments on commit ba2faba

Please sign in to comment.