Skip to content

Commit

Permalink
bug fix container start emit message
Browse files Browse the repository at this point in the history
  • Loading branch information
fredclausen committed Aug 15, 2023
1 parent dda3a25 commit e54a748
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions rootfs/monitor-hub/monitor-hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ def clear_logs(self):
db.close()
except Exception as e:
print(f"Error clearing logs: {e}")
finally:
containers.remove(self.name)
# remove container from the list of container classes
container_classes.remove(self)

def get_log(self, num_lines=50):
results = []
Expand Down Expand Up @@ -209,10 +213,7 @@ def container_logs(self, container):
{"name": container.name},
namespace="/main",
)

containers.remove(container.name)
# remove container from the list of container classes
container_classes.remove(self)
self.clear_logs()


def exit_handler(signal_received, _):
Expand Down Expand Up @@ -248,7 +249,7 @@ def check_for_new_containers():
print(f"New container: {c.get_name()}")
if container_ready:
socketio.emit(
"new_container",
"container_start",
{
"name": c.get_name(),
},
Expand Down

0 comments on commit e54a748

Please sign in to comment.