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