From 4b41718c78da922c880a8613eaa3bbf7f07f55a3 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Fri, 6 Jan 2023 17:09:41 +0100 Subject: [PATCH] ship_processor.go: Use redis.Namespace.NewKey() --- ship_processor.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ship_processor.go b/ship_processor.go index 27093d2..d7d3a66 100644 --- a/ship_processor.go +++ b/ship_processor.go @@ -32,7 +32,7 @@ func queueMessage(key redis.Key, payload []byte) bool { func encodeQueue(channel redis.Channel, v interface{}) bool { if payload, ok := encodeMessage(v); ok { - channel := redis.Key{NS: redisNs, Channel: channel} + channel := redisNs.NewKey(channel) if queueMessage(channel, payload) { return true } @@ -95,10 +95,10 @@ func processTraces(traces []*ship.TransactionTraceV0) { } channels := []redis.Key{ - {NS: redisNs, Channel: redis.ActionChannel{}}, - {NS: redisNs, Channel: redis.ActionChannel{Action: string(act.Action)}}, - {NS: redisNs, Channel: redis.ActionChannel{Contract: string(act.Contract)}}, - {NS: redisNs, Channel: redis.ActionChannel{Action: string(act.Action), Contract: string(act.Contract)}}, + redisNs.NewKey(redis.ActionChannel{}), + redisNs.NewKey(redis.ActionChannel{Action: string(act.Action)}), + redisNs.NewKey(redis.ActionChannel{Contract: string(act.Contract)}), + redisNs.NewKey(redis.ActionChannel{Action: string(act.Action), Contract: string(act.Contract)}), } for _, channel := range channels {