vapor / redis

Vapor provider for RediStack
MIT License
458 stars 57 forks source link

PubSub not work with redis 4.1.0 #185

Closed gulivero1773 closed 3 years ago

gulivero1773 commented 3 years ago

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. Add package with configuration '...'
  2. Send request with options When I use app.redis.subscribe(to: "service") { (channel, message) in
  3. No redis found for id default, or the app may not have finished booting. Also, the eventLoop must be from Application's EventLoopGroup.: file Redis/RedisStorage.swift, line 51 2021-02-27 21:25:57.161836+0200 Run[19967:238904] Fatal error: No redis found for id default, or the app may not have finished booting. Also, the eventLoop must be from Application's EventLoopGroup.: file Redis/RedisStorage.swift, line 51

Expected behavior

A clear and concise description of what you expected to happen.

Environment

Additional context

Add any other context about the problem here.

0xTim commented 3 years ago

@gulivero1773 if you add app.boot() before you call Redis does that fix it?

gulivero1773 commented 3 years ago

@0xTim Thank you! It works, but I don’t understand why

0xTim commented 3 years ago

@gulivero1773 Redis now needs the boot function to be called to set up its internal state correctly. Unfortunately this isn't yet documented