1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-07-04 12:03:41 +02:00

ship_processor.go: Use redis.Namespace.NewKey()

This commit is contained in:
Henrik Hautakoski 2023-01-06 17:09:41 +01:00
parent 1bc43cc87b
commit 4b41718c78

View file

@ -32,7 +32,7 @@ func queueMessage(key redis.Key, payload []byte) bool {
func encodeQueue(channel redis.Channel, v interface{}) bool { func encodeQueue(channel redis.Channel, v interface{}) bool {
if payload, ok := encodeMessage(v); ok { if payload, ok := encodeMessage(v); ok {
channel := redis.Key{NS: redisNs, Channel: channel} channel := redisNs.NewKey(channel)
if queueMessage(channel, payload) { if queueMessage(channel, payload) {
return true return true
} }
@ -95,10 +95,10 @@ func processTraces(traces []*ship.TransactionTraceV0) {
} }
channels := []redis.Key{ channels := []redis.Key{
{NS: redisNs, Channel: redis.ActionChannel{}}, redisNs.NewKey(redis.ActionChannel{}),
{NS: redisNs, Channel: redis.ActionChannel{Action: string(act.Action)}}, redisNs.NewKey(redis.ActionChannel{Action: string(act.Action)}),
{NS: redisNs, Channel: redis.ActionChannel{Contract: string(act.Contract)}}, redisNs.NewKey(redis.ActionChannel{Contract: string(act.Contract)}),
{NS: redisNs, Channel: redis.ActionChannel{Action: string(act.Action), Contract: string(act.Contract)}}, redisNs.NewKey(redis.ActionChannel{Action: string(act.Action), Contract: string(act.Contract)}),
} }
for _, channel := range channels { for _, channel := range channels {