Fix race condition and enable race diagnostics
This commit is contained in:
parent
8a4275ce61
commit
9f4148400e
3 changed files with 6 additions and 3 deletions
|
|
@ -10,7 +10,7 @@ builds:
|
|||
- id: evcc
|
||||
main: main.go
|
||||
flags:
|
||||
- -tags=release
|
||||
- -race -tags=release
|
||||
ldflags:
|
||||
- -X github.com/evcc-io/evcc/server.Version={{.Version}} -X github.com/evcc-io/evcc/server.Commit={{.ShortCommit}} -s -w
|
||||
env:
|
||||
|
|
@ -105,4 +105,4 @@ brews:
|
|||
<key>StandardErrorPath</key>
|
||||
<string>#{var}/log/evcc.log</string>
|
||||
</dict>
|
||||
</plist>
|
||||
</plist>
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -56,7 +56,7 @@ test:
|
|||
|
||||
build:
|
||||
@echo Version: $(VERSION) $(BUILD_DATE)
|
||||
go build -v $(BUILD_TAGS) $(BUILD_ARGS)
|
||||
go build -race -v $(BUILD_TAGS) $(BUILD_ARGS)
|
||||
|
||||
release-test:
|
||||
goreleaser --snapshot --skip-publish --rm-dist
|
||||
|
|
|
|||
|
|
@ -1281,7 +1281,10 @@ func (lp *LoadPoint) updateChargePower() {
|
|||
return err
|
||||
}
|
||||
|
||||
lp.Lock()
|
||||
lp.chargePower = value // update value if no error
|
||||
lp.Unlock()
|
||||
|
||||
lp.log.DEBUG.Printf("charge power: %.0fW", value)
|
||||
lp.publish("chargePower", value)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue