Try resolving pointer error.
All checks were successful
Build Docker image / build (push) Successful in 55s
All checks were successful
Build Docker image / build (push) Successful in 55s
This commit is contained in:
parent
4aa065ee82
commit
38691f4e85
1 changed files with 1 additions and 9 deletions
10
main.go
10
main.go
|
@ -73,11 +73,9 @@ type Payload struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
var db *sql.DB
|
var db *sql.DB
|
||||||
var logger *slog.Logger
|
var logger = slog.New(slog.NewJSONHandler(os.Stdout, nil))
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Setup slog
|
|
||||||
logger := slog.New(slog.NewJSONHandler(os.Stdout, nil))
|
|
||||||
slog.SetDefault(logger)
|
slog.SetDefault(logger)
|
||||||
|
|
||||||
// Load environment variables from .env file if it exists
|
// Load environment variables from .env file if it exists
|
||||||
|
@ -156,12 +154,6 @@ func mqttMessageHandler(client mqtt.Client, msg mqtt.Message) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// payload.Dt1 = updateFieldIfChanged(payload.Dt1, &prevDt1)
|
|
||||||
// payload.Dt2 = updateFieldIfChanged(payload.Dt2, &prevDt2)
|
|
||||||
// payload.Rt1 = updateFieldIfChanged(payload.Rt1, &prevRt1)
|
|
||||||
// payload.Rt2 = updateFieldIfChanged(payload.Rt2, &prevRt2)
|
|
||||||
// payload.G = updateFieldIfChanged(payload.G, &prevG)
|
|
||||||
|
|
||||||
var changed bool // Flag to track if any value changed
|
var changed bool // Flag to track if any value changed
|
||||||
|
|
||||||
// Update each field, directly updating `changed` if any change is detected
|
// Update each field, directly updating `changed` if any change is detected
|
||||||
|
|
Loading…
Reference in a new issue