add remove buses when empty
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package models
|
||||
|
||||
import "slices"
|
||||
import (
|
||||
"slices"
|
||||
)
|
||||
|
||||
// driver model
|
||||
type Driver struct {
|
||||
@@ -46,9 +48,11 @@ func (d *Driver) RemoveBuses(buses []*Bus) {
|
||||
}
|
||||
|
||||
currentBus.RemoveAddress(bus.Address...)
|
||||
|
||||
if bus.Topic != nil {
|
||||
currentBus.RemoveSubscription(bus.Topic.Subscribe...)
|
||||
currentBus.RemovePublish(bus.Topic.Publish...)
|
||||
|
||||
if len(currentBus.Address) == 0 {
|
||||
var remove bool = true
|
||||
if currentBus.Topic != nil {
|
||||
|
Reference in New Issue
Block a user