Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed May 26, 2024
1 parent 08f7f32 commit fb3d1cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
21 changes: 0 additions & 21 deletions _examples/document_sync/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,6 @@ func main() {
LogHandler: handleLog,
})

redisShardConfigs := []centrifuge.RedisShardConfig{
{Address: "localhost:6379"},
}
var redisShards []*centrifuge.RedisShard
for _, redisConf := range redisShardConfigs {
redisShard, err := centrifuge.NewRedisShard(node, redisConf)
if err != nil {
log.Fatal(err)
}
redisShards = append(redisShards, redisShard)
}

broker, err := centrifuge.NewRedisBroker(node, centrifuge.RedisBrokerConfig{
// And configure a couple of shards to use.
Shards: redisShards,
})
if err != nil {
log.Fatal(err)
}
node.SetBroker(broker)

node.OnConnect(func(client *centrifuge.Client) {
transport := client.Transport()
log.Printf("user %s connected via %s with protocol: %s", client.UserID(), transport.Name(), transport.Protocol())
Expand Down
6 changes: 3 additions & 3 deletions broker_redis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1965,13 +1965,13 @@ func TestParseDeltaPush(t *testing.T) {
name string
input string
expectError bool
expectedResult *deltaPublicationPush
expectedResult deltaPublicationPush
}{
{
name: "valid data with colon in payload",
input: "d1:1234567890:epoch1:4:test:18:payload:with:colon",
expectError: false,
expectedResult: &deltaPublicationPush{
expectedResult: deltaPublicationPush{
Offset: 1234567890,
Epoch: "epoch1",
PrevPayloadLength: 4,
Expand All @@ -1984,7 +1984,7 @@ func TestParseDeltaPush(t *testing.T) {
name: "valid data with empty payload",
input: "d1:1234567890:epoch2:0::0:",
expectError: false,
expectedResult: &deltaPublicationPush{
expectedResult: deltaPublicationPush{
Offset: 1234567890,
Epoch: "epoch2",
PrevPayloadLength: 0,
Expand Down

0 comments on commit fb3d1cd

Please sign in to comment.