Skip to content

Commit

Permalink
fix: fail to open pub/sub in cluster mode tiny-craft#239
Browse files Browse the repository at this point in the history
  • Loading branch information
tiny-craft committed Apr 26, 2024
1 parent d414213 commit 8139481
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions backend/services/pubsub_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package services

import (
"context"
"errors"
"fmt"
"github.com/redis/go-redis/v9"
"github.com/wailsapp/wails/v2/pkg/runtime"
Expand All @@ -13,7 +12,7 @@ import (
)

type pubsubItem struct {
client *redis.Client
client redis.UniversalClient
pubsub *redis.PubSub
mutex sync.Mutex
closeCh chan struct{}
Expand Down Expand Up @@ -62,12 +61,8 @@ func (p *pubsubService) getItem(server string) (*pubsubItem, error) {
if uniClient, err = Connection().createRedisClient(conf.ConnectionConfig); err != nil {
return nil, err
}
var client *redis.Client
if client, ok = uniClient.(*redis.Client); !ok {
return nil, errors.New("create redis client fail")
}
item = &pubsubItem{
client: client,
client: uniClient,
}
p.items[server] = item
}
Expand Down

0 comments on commit 8139481

Please sign in to comment.