|
6 | 6 | "strings"
|
7 | 7 | "sync"
|
8 | 8 |
|
9 |
| - uuid "github.com/gofrs/uuid" |
10 | 9 | "github.com/gomodule/redigo/redis"
|
11 | 10 | )
|
12 | 11 |
|
@@ -123,7 +122,7 @@ func newRedisBroadcast(nsp string, adapter *RedisAdapterOptions) (*redisBroadcas
|
123 | 122 | bc.sub = redis.PubSubConn{Conn: sub}
|
124 | 123 |
|
125 | 124 | bc.nsp = nsp
|
126 |
| - bc.uid = uuid.Must(uuid.NewV4()).String() |
| 125 | + bc.uid = newV4UUID() |
127 | 126 | bc.key = bc.prefix + "#" + bc.nsp + "#" + bc.uid
|
128 | 127 | bc.reqChannel = bc.prefix + "-request#" + bc.nsp
|
129 | 128 | bc.resChannel = bc.prefix + "-response#" + bc.nsp
|
@@ -355,7 +354,7 @@ func (bc *redisBroadcast) Clear(room string) {
|
355 | 354 | func (bc *redisBroadcast) publishClear(room string) {
|
356 | 355 | req := clearRoomRequest{
|
357 | 356 | RequestType: clearRoomReqType,
|
358 |
| - RequestID: uuid.Must(uuid.NewV4()).String(), |
| 357 | + RequestID: newV4UUID(), |
359 | 358 | Room: room,
|
360 | 359 | UUID: bc.uid,
|
361 | 360 | }
|
@@ -456,7 +455,7 @@ func (bc *redisBroadcast) Len(room string) int {
|
456 | 455 |
|
457 | 456 | req := roomLenRequest{
|
458 | 457 | RequestType: roomLenReqType,
|
459 |
| - RequestID: uuid.Must(uuid.NewV4()).String(), |
| 458 | + RequestID: newV4UUID(), |
460 | 459 | Room: room,
|
461 | 460 | }
|
462 | 461 |
|
@@ -494,7 +493,7 @@ func (bc *redisBroadcast) AllRooms() []string {
|
494 | 493 |
|
495 | 494 | req := allRoomRequest{
|
496 | 495 | RequestType: allRoomReqType,
|
497 |
| - RequestID: uuid.Must(uuid.NewV4()).String(), |
| 496 | + RequestID: newV4UUID(), |
498 | 497 | }
|
499 | 498 | reqJSON, _ := json.Marshal(&req)
|
500 | 499 |
|
|
0 commit comments