Vehicle: don't instantiate disabled vehicles (#32919)
This commit is contained in:
parent
8cf5a44a32
commit
adfbd057b0
5 changed files with 74 additions and 12 deletions
11
cmd/setup.go
11
cmd/setup.go
|
|
@ -538,9 +538,14 @@ func configureVehicles(static []config.Named, names ...string) error {
|
|||
}
|
||||
}
|
||||
|
||||
instance, err := vehicleInstance(cc)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot create vehicle '%s': %w", cc.Name, err)
|
||||
// disabled vehicles are not instantiated
|
||||
var instance api.Vehicle
|
||||
if !conf.Disable {
|
||||
var err error
|
||||
instance, err = vehicleInstance(cc)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot create vehicle '%s': %w", cc.Name, err)
|
||||
}
|
||||
}
|
||||
|
||||
mu.Lock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue