Skip to content

Commit

Permalink
Do not panic on invalid metrics data.
Browse files Browse the repository at this point in the history
  • Loading branch information
brocaar committed Sep 1, 2022
1 parent 619e516 commit d8ea9ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ func migrateDeviceMetrics(devEUI []byte) {
}

if err := csRedis.HSet(context.Background(), newKey, vals).Err(); err != nil {
panic(err)
log.Printf("Migrate device metrics error: %s", err)
}
if err := csRedis.PExpire(context.Background(), newKey, ttl[aggregation]).Err(); err != nil {
panic(err)
Expand Down Expand Up @@ -1146,7 +1146,7 @@ func migrateGatewayMetrics(gatewayID []byte) {
}

if err := csRedis.HSet(context.Background(), newKey, vals).Err(); err != nil {
panic(err)
log.Panicf("Migrate gateway metrics error: %s", err)
}
if err := csRedis.PExpire(context.Background(), newKey, ttl[aggregation]).Err(); err != nil {
panic(err)
Expand Down

0 comments on commit d8ea9ed

Please sign in to comment.