From d0782c3c7c712ef931c92c093e9da81ba882f3a2 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Fri, 13 Jan 2023 13:33:01 +0100 Subject: [PATCH] ship_processor.go: Use publisher instead of redis directly. --- ship_processor.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ship_processor.go b/ship_processor.go index 611cae3..aed010a 100644 --- a/ship_processor.go +++ b/ship_processor.go @@ -36,7 +36,7 @@ func encodeMessage(v interface{}) ([]byte, bool) { func queueMessage(channel redis.ChannelInterface, payload []byte) bool { key := redisNs.NewKey(channel) - err := redis.RegisterPublish(key.String(), payload).Err() + err := publisher.Publish(key.String(), payload) if err != nil { log.WithError(err).Errorf("Failed to post to channel '%s'", key) return false @@ -67,9 +67,9 @@ func processBlock(block *ship.GetBlocksResultV0) { encodeQueue(redis.HeartbeatChannel, hb) - _, err := redis.Send() + err := publisher.Flush() if err != nil { - log.WithError(err).Error("Failed to send redis") + log.WithError(err).Error("Failed to send messages") } } } @@ -120,8 +120,8 @@ func processTraces(traces []*ship.TransactionTraceV0) { } } - _, err := redis.Send() + err := publisher.Flush() if err != nil { - log.WithError(err).Error("Failed to send redis") + log.WithError(err).Error("Failed to send messages") } }