diff --git a/api/redis/publisher.go b/api/redis/publisher.go index 7845e59..fd24552 100644 --- a/api/redis/publisher.go +++ b/api/redis/publisher.go @@ -14,10 +14,10 @@ type Publisher struct { ns Namespace } -func NewPublisher(client *redis.Client, ns Namespace) *Publisher { +func NewPublisher(ctx context.Context, client *redis.Client, ns Namespace) *Publisher { return &Publisher{ pipeline: client.Pipeline(), - ctx: client.Context(), + ctx: ctx, ns: ns, } } diff --git a/api/redis/publisher_test.go b/api/redis/publisher_test.go index 4986215..c50f2cd 100644 --- a/api/redis/publisher_test.go +++ b/api/redis/publisher_test.go @@ -12,7 +12,7 @@ import ( func TestPublisher_Write(t *testing.T) { client, mock := redismock.NewClientMock() - pub := NewPublisher(client, Namespace{ChainID: "id"}) + pub := NewPublisher(context.Background(), client, Namespace{ChainID: "id"}) mock.MatchExpectationsInOrder(true) mock.ExpectPublish("ship::id::test", []byte("some string")).SetVal(0) diff --git a/cmd/thalos/main.go b/cmd/thalos/main.go index 5045673..9d16ec5 100644 --- a/cmd/thalos/main.go +++ b/cmd/thalos/main.go @@ -271,7 +271,7 @@ func main() { processor := app.SpawnProccessor( shClient, - api_redis.NewPublisher(rdb, api_redis.Namespace{ + api_redis.NewPublisher(context.Background(), rdb, api_redis.Namespace{ Prefix: conf.Redis.Prefix, ChainID: getChain(chainInfo.ChainID.String()), }),