Skip to content

Commit

Permalink
fix(dashboard): finally resolve #186 by cleanly shutting down dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
BjoernLudwigPTB committed Mar 12, 2021
1 parent c2ca702 commit 9903d15
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions agentMET4FOF/dashboard/Dashboard.py
Expand Up @@ -161,6 +161,11 @@ def is_port_available(self, ip_addr, _port):
class AgentDashboardProcess(AgentDashboard, pathos.helpers.mp.Process):
"""Represents an agent dashboard for the osBrain backend"""

def terminate(self):
"""This is shutting down the application server serving the web interface"""
super(AgentDashboardProcess, self).terminate()
self._server.server_close()


class AgentDashboardThread(AgentDashboard, Thread):
"""Represents an agent dashboard for the Mesa backend"""
Expand Down Expand Up @@ -206,6 +211,7 @@ def terminate(self):
"""This is shutting down the application server serving the web interface"""
try:
self._server.shutdown()
self._server.server_close()
except AttributeError:
# In this case the dashboard has in fact already been shutdown earlier.
pass
Expand Down

0 comments on commit 9903d15

Please sign in to comment.