PLT-5977: Only reload clients when client config changes. (#5989)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
997b35d2fc
Коммит
87343176fc
@@ -149,7 +149,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
c.SetSiteURLHeader(app.GetProtocol(r) + "://" + r.Host)
|
||||
|
||||
w.Header().Set(model.HEADER_REQUEST_ID, c.RequestId)
|
||||
w.Header().Set(model.HEADER_VERSION_ID, fmt.Sprintf("%v.%v.%v.%v", model.CurrentVersion, model.BuildNumber, utils.CfgHash, utils.IsLicensed))
|
||||
w.Header().Set(model.HEADER_VERSION_ID, fmt.Sprintf("%v.%v.%v.%v", model.CurrentVersion, model.BuildNumber, utils.ClientCfgHash, utils.IsLicensed))
|
||||
if einterfaces.GetClusterInterface() != nil {
|
||||
w.Header().Set(model.HEADER_CLUSTER_ID, einterfaces.GetClusterInterface().GetClusterId())
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
c.SetSiteURLHeader(app.GetProtocol(r) + "://" + r.Host)
|
||||
|
||||
w.Header().Set(model.HEADER_REQUEST_ID, c.RequestId)
|
||||
w.Header().Set(model.HEADER_VERSION_ID, fmt.Sprintf("%v.%v.%v.%v", model.CurrentVersion, model.BuildNumber, utils.CfgHash, utils.IsLicensed))
|
||||
w.Header().Set(model.HEADER_VERSION_ID, fmt.Sprintf("%v.%v.%v.%v", model.CurrentVersion, model.BuildNumber, utils.ClientCfgHash, utils.IsLicensed))
|
||||
if einterfaces.GetClusterInterface() != nil {
|
||||
w.Header().Set(model.HEADER_CLUSTER_ID, einterfaces.GetClusterInterface().GetClusterId())
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ func (webCon *WebConn) IsAuthenticated() bool {
|
||||
|
||||
func (webCon *WebConn) SendHello() {
|
||||
msg := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_HELLO, "", "", webCon.UserId, nil)
|
||||
msg.Add("server_version", fmt.Sprintf("%v.%v.%v.%v", model.CurrentVersion, model.BuildNumber, utils.CfgHash, utils.IsLicensed))
|
||||
msg.Add("server_version", fmt.Sprintf("%v.%v.%v.%v", model.CurrentVersion, model.BuildNumber, utils.ClientCfgHash, utils.IsLicensed))
|
||||
webCon.Send <- msg
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ var watcher *fsnotify.Watcher
|
||||
var Cfg *model.Config = &model.Config{}
|
||||
var CfgDiagnosticId = ""
|
||||
var CfgHash = ""
|
||||
var ClientCfgHash = ""
|
||||
var CfgFileName string = ""
|
||||
var ClientCfg map[string]string = map[string]string{}
|
||||
var originalDisableDebugLvl l4g.Level = l4g.DEBUG
|
||||
@@ -313,6 +314,8 @@ func LoadConfig(fileName string) {
|
||||
Cfg = &config
|
||||
CfgHash = fmt.Sprintf("%x", md5.Sum([]byte(Cfg.ToJson())))
|
||||
ClientCfg = getClientConfig(Cfg)
|
||||
clientCfgJson, _ := json.Marshal(ClientCfg)
|
||||
ClientCfgHash = fmt.Sprintf("%x", md5.Sum(clientCfgJson))
|
||||
|
||||
// Actions that need to run every time the config is loaded
|
||||
if ldapI := einterfaces.GetLdapInterface(); ldapI != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user