Skip to content

Commit

Permalink
Remove device lock when downlink can't be sent because of gateway lock.
Browse files Browse the repository at this point in the history
In this case, we have locked the device, but the downlink is aborted
because the gateway is locked. In such case the device lock must be
removed as nothing was actually sent to the device.
  • Loading branch information
brocaar committed Jul 6, 2021
1 parent 3609f4f commit ea8759a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/downlink/data/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,11 @@ func getDownlinkGatewayLock(ctx *dataContext) error {
}

if !set {
// the gateway is already locked
// the gateway is already locked, remove the device lock (as nothing was sent
// for this device) and abort.
key := storage.GetRedisKey(deviceDownlinkLockKey, ctx.DeviceSession.DevEUI)
_ = storage.RedisClient().Del(ctx.ctx, key).Err()

return ErrAbort
}

Expand Down

0 comments on commit ea8759a

Please sign in to comment.