File tree 5 files changed +14
-6
lines changed
5 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -4,13 +4,13 @@ go 1.18
4
4
5
5
require (
6
6
github.com/dgrijalva/jwt-go v3.2.0+incompatible
7
- github.com/go-redis/redis/v9 v9.0.0-beta.1
8
7
github.com/google/uuid v1.3.0
9
8
github.com/gorilla/websocket v1.5.0
10
9
github.com/julienschmidt/httprouter v1.3.0
11
10
)
12
11
13
12
require (
14
- github.com/cespare/xxhash/v2 v2.1.2 // indirect
13
+ github.com/cespare/xxhash/v2 v2.2.0 // indirect
15
14
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
15
+ github.com/redis/go-redis/v9 v9.4.0
16
16
)
Original file line number Diff line number Diff line change 1
1
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE =
2
2
github.com/cespare/xxhash/v2 v2.1.2 /go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs =
3
+ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44 =
4
+ github.com/cespare/xxhash/v2 v2.2.0 /go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs =
3
5
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM =
4
6
github.com/dgrijalva/jwt-go v3.2.0+incompatible /go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ =
5
7
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78 =
@@ -16,6 +18,8 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8
16
18
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE =
17
19
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE =
18
20
github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw =
21
+ github.com/redis/go-redis/v9 v9.4.0 h1:Yzoz33UZw9I/mFhx4MNrB6Fk+XHO1VukNcCa1+lwyKk =
22
+ github.com/redis/go-redis/v9 v9.4.0 /go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M =
19
23
golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc =
20
24
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM =
21
25
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk =
Original file line number Diff line number Diff line change 4
4
"context"
5
5
"time"
6
6
7
- "github.com/go- redis/redis/v9"
7
+ "github.com/redis/go- redis/v9"
8
8
)
9
9
10
10
func NewRedis () * redis.Client {
Original file line number Diff line number Diff line change 7
7
"sync"
8
8
9
9
"github.com/alextanhongpin/go-chat.v2/pkg/socketio"
10
- "github.com/go- redis/redis/v9"
10
+ "github.com/redis/go- redis/v9"
11
11
)
12
12
13
13
var friends = map [string ][]string {
Original file line number Diff line number Diff line change 7
7
"log"
8
8
"sync"
9
9
10
- "github.com/go- redis/redis/v9"
10
+ "github.com/redis/go- redis/v9"
11
11
)
12
12
13
13
type IORedis [T any ] struct {
@@ -87,7 +87,11 @@ func (io *IORedis[T]) subscribe(ch chan<- T) {
87
87
select {
88
88
case <- io .done :
89
89
return
90
- case data := <- pubsub .Channel ():
90
+ case data , ok := <- pubsub .Channel ():
91
+ if ! ok {
92
+ log .Printf ("ioredis: channel closed\n " )
93
+ }
94
+
91
95
var msg T
92
96
if err := json .Unmarshal ([]byte (data .Payload ), & msg ); err != nil {
93
97
log .Printf ("ioredis: unmarshal error: %s\n " , err )
You can’t perform that action at this time.
0 commit comments