tlaverdure / laravel-echo-server

Socket.io server for Laravel Echo
MIT License
2.65k stars 510 forks source link

Redis DB index ignored #157

Open blazeu opened 7 years ago

blazeu commented 7 years ago

I have 2 instances laravel-echo-server running on different port, responding to 2 different Laravel application & Redis instances. But both laravel-echo-server seems to listen to all redis events. I've set the index in the config.

"databaseConfig": {
    "redis": {
        "db": 1
    }
}
jastend commented 7 years ago

Hi,

I'm having the same issue. Regardless of which value I set, it always uses the DB 0.

Update

Disregard. I forgot to restart the Echo server so that the changes would take effect. This works as expected.

deefour commented 7 years ago

I'm having an issue too. My configuration is correct to connect to redis db index 1, but laravel-echo-server still seems to be listening to broadcast events on db index 0.

I ran the following to dump ioredis debug data:

DEBUG="ioredis:redis" ./node_modules/.bin/laravel-echo-server start

and I see the following output:

  Running at localhost on port 6002
  ioredis:redis status[localhost:6379]: [empty] -> connecting +0ms
  Channels are ready.
  ioredis:redis status[localhost:6379]: [empty] -> connecting +2ms
  Listening for http events...
  ioredis:redis queue command[1] -> psubscribe(*) +2ms
  ioredis:redis status[127.0.0.1:6379]: connecting -> connect +7ms
  ioredis:redis write command[1] -> select(1) +0ms
  ioredis:redis write command[1] -> info() +1ms

This looks like it's subscribing on redis db 0 and then selecting db index 1.

Am I missing something?