Unsubscribe any open event listeners when deleting a server

This commit is contained in:
Dane Everitt
2020-05-03 21:30:16 -07:00
parent fab489d264
commit 2e055cf630
2 changed files with 26 additions and 7 deletions

View File

@@ -178,6 +178,9 @@ func deleteServer(c *gin.Context) {
zap.S().Warnw("failed to delete server archive during deletion process", zap.String("server", s.Uuid), zap.Error(err))
}
// Unsubscribe all of the event listeners.
s.Events().UnsubscribeAll()
// Destroy the environment; in Docker this will handle a running container and
// forcibly terminate it before removing the container, so we do not need to handle
// that here.