chore: fix race condition
This commit is contained in:
parent
80b2c79e0d
commit
ee2284a6ae
1 changed files with 3 additions and 0 deletions
|
|
@ -557,6 +557,9 @@ var _ api.CurrentGetter = (*EEBus)(nil)
|
|||
|
||||
// GetMaxCurrent implements the api.CurrentGetter interface
|
||||
func (c *EEBus) GetMaxCurrent() (float64, error) {
|
||||
c.mux.RLock()
|
||||
defer c.mux.RUnlock()
|
||||
|
||||
if c.currentLimit == -1 {
|
||||
return 0, api.ErrNotAvailable
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue