wshandler config 수정
This commit is contained in:
@ -143,14 +143,10 @@ type WebsocketHandler struct {
|
||||
}
|
||||
|
||||
type wsConfig struct {
|
||||
gocommon.StorageAddr
|
||||
Maingate string `json:"maingate_service_url"`
|
||||
gocommon.StorageAddr `json:"storage"`
|
||||
}
|
||||
|
||||
var config wsConfig
|
||||
|
||||
func init() {
|
||||
gocommon.LoadConfig(&config)
|
||||
gob.Register(UpstreamMessage{})
|
||||
gob.Register(commandMessage{})
|
||||
gob.Register(map[string]any{})
|
||||
@ -161,6 +157,11 @@ func init() {
|
||||
}
|
||||
|
||||
func NewWebsocketHandler(consumer session.Consumer) (*WebsocketHandler, error) {
|
||||
var config wsConfig
|
||||
if err := gocommon.LoadConfig(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
redisSync, err := gocommon.NewRedisClient(config.Redis["wshandler"])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user