Skip to content
This repository was archived by the owner on May 2, 2025. It is now read-only.

Commit 4b3020a

Browse files
Use GetRedisKey for key generation in MQTT Integration (#610)
1 parent 7bd8c3c commit 4b3020a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/integration/mqtt/mqtt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ func (i *Integration) txPayloadHandler(mqttc mqtt.Client, msg mqtt.Message) {
408408
// Since with MQTT all subscribers will receive the downlink messages sent
409409
// by the application, the first instance receiving the message must lock it,
410410
// so that other instances can ignore the message.
411-
key := fmt.Sprintf("lora:as:downlink:lock:%d:%s:%x", pl.ApplicationID, pl.DevEUI, sha256.Sum256(msg.Payload()))
411+
key := storage.GetRedisKey("lora:as:downlink:lock:%d:%s:%x", pl.ApplicationID, pl.DevEUI, sha256.Sum256(msg.Payload()))
412412
set, err := storage.RedisClient().SetNX(context.Background(), key, "lock", downlinkLockTTL).Result()
413413
if err != nil {
414414
log.WithError(err).Error("integration/mqtt: acquire lock error")

0 commit comments

Comments
 (0)