|
|
@ -89,19 +89,23 @@ class Server: |
|
|
|
app.logger.debug('STARTING SERVER') |
|
|
|
app.logger.debug('STARTING SERVER') |
|
|
|
self.define_wsgi() |
|
|
|
self.define_wsgi() |
|
|
|
self.wsgiserver.serve_forever() |
|
|
|
self.wsgiserver.serve_forever() |
|
|
|
|
|
|
|
if self.restart: |
|
|
|
|
|
|
|
app.logger.info('Restarting Server') |
|
|
|
|
|
|
|
try: |
|
|
|
|
|
|
|
subprocess.check_call([sys.executable, 'start.py']) |
|
|
|
|
|
|
|
except subprocess.CalledProcessError as e: |
|
|
|
|
|
|
|
print(e) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def stop_server(self): |
|
|
|
def stop_server(self): |
|
|
|
app.logger.debug('STOPPING SERVER') |
|
|
|
app.logger.debug('STOPPING SERVER') |
|
|
|
self.wsgiserver.stop() |
|
|
|
self.wsgiserver.stop() |
|
|
|
|
|
|
|
|
|
|
|
def restart_server(self, ignored_signum, ignored_frame): |
|
|
|
def restart_server(self, ignored_signum, ignored_frame): |
|
|
|
|
|
|
|
self.restart = True |
|
|
|
app.logger.debug('Restarting Server') |
|
|
|
app.logger.debug('Restarting Server') |
|
|
|
if self.wsgiserver is not None : |
|
|
|
if self.wsgiserver is not None : |
|
|
|
self.wsgiserver.stop() |
|
|
|
self.wsgiserver.stop() |
|
|
|
try: |
|
|
|
|
|
|
|
subprocess.check_call([sys.executable, 'start.py']) |
|
|
|
|
|
|
|
except subprocess.CalledProcessError as e: |
|
|
|
|
|
|
|
print(e) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
server = Server() |
|
|
|
server = Server() |
|
|
|