Skip to content

Commit

Permalink
Fix shutdown behavior on Windows.
Browse files Browse the repository at this point in the history
abalijepalli committed Apr 14, 2021
1 parent 85de20c commit 2f0cf5a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mosaicweb/views.py
Original file line number Diff line number Diff line change
@@ -486,14 +486,24 @@ def _shutdownServer():

logger.info("Starting shutdown.")

if sys.platform.startswith('win'):
func = request.environ.get('werkzeug.server.shutdown')
if func is None:
raise RuntimeError('No servers found.')


for k, s in gAnalysisSessions.items():
logger.info('Shutting down running analysis {0}'.format(k))
if s['analysisRunning']:
s['mosaicAnalysisObject'].stopAnalysis()


logger.info("Shutdown complete.")
sys.exit(errno.EINTR)

if sys.platform.startswith('win'):
func()
else:
sys.exit(errno.EINTR)

def _folderDesc(item):
nqdf = len(glob.glob(item+'/*.qdf'))

0 comments on commit 2f0cf5a

Please sign in to comment.