Skip to content

Commit

Permalink
Use GetRedisKey for key generation in MQTT Integration (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar-patel-sls authored Jul 13, 2021
1 parent 7bd8c3c commit 4b3020a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/integration/mqtt/mqtt.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ func (i *Integration) txPayloadHandler(mqttc mqtt.Client, msg mqtt.Message) {
// Since with MQTT all subscribers will receive the downlink messages sent
// by the application, the first instance receiving the message must lock it,
// so that other instances can ignore the message.
key := fmt.Sprintf("lora:as:downlink:lock:%d:%s:%x", pl.ApplicationID, pl.DevEUI, sha256.Sum256(msg.Payload()))
key := storage.GetRedisKey("lora:as:downlink:lock:%d:%s:%x", pl.ApplicationID, pl.DevEUI, sha256.Sum256(msg.Payload()))
set, err := storage.RedisClient().SetNX(context.Background(), key, "lock", downlinkLockTTL).Result()
if err != nil {
log.WithError(err).Error("integration/mqtt: acquire lock error")
Expand Down

0 comments on commit 4b3020a

Please sign in to comment.