Make sure httpd server stops after a certain time frame.

This commit is contained in:
blitzmann
2015-10-25 00:09:33 -04:00
parent 167eb60fe3
commit 8f08f8efb8

View File

@@ -93,13 +93,18 @@ class Crest():
self.ssoTimer.stop()
wx.CallAfter(pub.sendMessage, 'logout_success', message=None)
def stopServer(self):
self.httpd.stop()
self.httpdTimer.stop()
def startServer(self):
thread.start_new_thread(self.httpd.serve, ())
self.httpdTimer = RepeatedTimer(60, self.stopServer)
self.httpdTimer.start()
self.state = str(uuid.uuid4())
return self.eve.auth_uri(scopes=self.scopes, state=self.state)
def handleLogin(self, message):
self.httpd.stop()
if not message:
return
@@ -147,5 +152,3 @@ class Crest():
wx.CallAfter(pub.sendMessage, 'login_success', type=1)