Squashed commit of the following:
commit29b2f25850Author: mountain <mountain@action2quare.com> Date: Wed Jul 19 09:33:37 2023 +0900 타입 이름 변경 commit256bfd030cAuthor: mountain <mountain@action2quare.com> Date: Wed Jul 19 09:31:01 2023 +0900 redison 추가 commit72a683fed2Author: mountain <mountain@action2quare.com> Date: Tue Jul 18 19:51:24 2023 +0900 gob에 []any 추가 commit89fa9e4ac5Author: mountain <mountain@action2quare.com> Date: Tue Jul 18 17:45:12 2023 +0900 write control 수정 commitd724cc84faAuthor: mountain <mountain@action2quare.com> Date: Tue Jul 18 17:38:04 2023 +0900 redis pubsub 채널 이름에 디비 인덱스 추가 commit8df248fa54Author: mountain <mountain@action2quare.com> Date: Tue Jul 18 17:20:47 2023 +0900 close를 writecontrol로 변경 commit40a603522dAuthor: mountain <mountain@action2quare.com> Date: Tue Jul 18 12:21:06 2023 +0900 conn에 msg를 쓰는 쓰레드 단일화 commitc21017d2cdAuthor: mountain <mountain@action2quare.com> Date: Tue Jul 18 11:08:38 2023 +0900 redis call이 문제가 아니었음 commit82abcddb49Author: mountain <mountain@action2quare.com> Date: Tue Jul 18 11:04:15 2023 +0900 잦은 redis call 회피 commit289af24a8fAuthor: mountain <mountain@action2quare.com> Date: Tue Jul 18 09:55:18 2023 +0900 room create 메시지 전송 commit4b35e0e638Author: mountain <mountain@action2quare.com> Date: Tue Jul 18 09:45:27 2023 +0900 EventReceiver 인터페이스 추가 commit29843802ffAuthor: mountain <mountain@action2quare.com> Date: Mon Jul 17 17:45:40 2023 +0900 gob 등록 commit66aea48fb7Author: mountain <mountain@action2quare.com> Date: Sun Jul 16 18:39:11 2023 +0900 채널간 publish marshalling을 gob으로 변경 commit8f6c87a8aeAuthor: mountain <mountain@action2quare.com> Date: Sun Jul 16 16:37:02 2023 +0900 redis option을 copy로 변경 commitf0f459332dAuthor: mountain <mountain@action2quare.com> Date: Sat Jul 15 17:08:33 2023 +0900 wshandler에서 authcache제거하고 config 포맷 변경
This commit is contained in:
@ -30,7 +30,7 @@ type Authinfo struct {
|
||||
}
|
||||
|
||||
const (
|
||||
sessionSyncChannelName = "session-sync-channel2"
|
||||
sessionSyncChannelNamePrefix = "session-sync-channel2"
|
||||
)
|
||||
|
||||
type AuthinfoCell interface {
|
||||
@ -99,6 +99,8 @@ func (ac *redisAuthCell) ToBytes() []byte {
|
||||
func newAuthCollectionWithRedis(redisClient *redis.Client, subctx context.Context, maingateURL string, apiToken string) *AuthCollection {
|
||||
sessionTTL := int64(3600)
|
||||
ac := MakeAuthCollection(time.Duration(sessionTTL * int64(time.Second)))
|
||||
|
||||
sessionSyncChannelName := fmt.Sprintf("%s-%d", sessionSyncChannelNamePrefix, redisClient.Options().DB)
|
||||
pubsub := redisClient.Subscribe(subctx, sessionSyncChannelName)
|
||||
ctx, cancel := context.WithCancel(context.TODO())
|
||||
go func(ctx context.Context, sub *redis.PubSub, authCache *AuthCollection) {
|
||||
@ -205,7 +207,7 @@ func (acg *AuthCollectionGlobal) Reload(context context.Context) error {
|
||||
for r, url := range config.RegionStorage {
|
||||
if _, ok := oldval[r]; !ok {
|
||||
// 새로 생겼네
|
||||
redisClient, err := NewRedisClient(url.Redis.URL, url.Redis.Offset["session"])
|
||||
redisClient, err := NewRedisClient(url.Redis["session"])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -228,7 +230,7 @@ func NewAuthCollectionGlobal(context context.Context, apiToken string) (AuthColl
|
||||
|
||||
output := make(map[string]*AuthCollection)
|
||||
for region, url := range config.RegionStorage {
|
||||
redisClient, err := NewRedisClient(url.Redis.URL, url.Redis.Offset["session"])
|
||||
redisClient, err := NewRedisClient(url.Redis["session"])
|
||||
if err != nil {
|
||||
return AuthCollectionGlobal{}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user