Skip to content

Commit

Permalink
feat: revert ring.go
Browse files Browse the repository at this point in the history
  • Loading branch information
SoulPancake committed Jul 23, 2023
1 parent 8045439 commit 4145372
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 0 additions & 2 deletions pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ type PubSub struct {
closed bool
exit chan struct{}

err error

cmd *Cmd

chOnce sync.Once
Expand Down
15 changes: 6 additions & 9 deletions ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,8 @@ func (c *Ring) Subscribe(ctx context.Context, channels ...string) *PubSub {

shard, err := c.sharding.GetByKey(channels[0])
if err != nil {
return &PubSub{
err: err,
}
// TODO: return PubSub with sticky error
panic(err)
}
return shard.Client.Subscribe(ctx, channels...)
}
Expand All @@ -595,9 +594,8 @@ func (c *Ring) PSubscribe(ctx context.Context, channels ...string) *PubSub {

shard, err := c.sharding.GetByKey(channels[0])
if err != nil {
return &PubSub{
err: err,
}
// TODO: return PubSub with sticky error
panic(err)
}
return shard.Client.PSubscribe(ctx, channels...)
}
Expand All @@ -609,9 +607,8 @@ func (c *Ring) SSubscribe(ctx context.Context, channels ...string) *PubSub {
}
shard, err := c.sharding.GetByKey(channels[0])
if err != nil {
return &PubSub{
err: err,
}
// TODO: return PubSub with sticky error
panic(err)
}
return shard.Client.SSubscribe(ctx, channels...)
}
Expand Down

0 comments on commit 4145372

Please sign in to comment.