mattermost/wsapi/system.go
Chris 91bfc72a99 Reduce logging data races, fix MySQL test race condition (#7994)
* fix races

* revert unintentional change

* fix test as intended
2017-12-22 12:09:33 +00:00

22 lines
545 B
Go

// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package wsapi
import (
"github.com/mattermost/mattermost-server/model"
)
func (api *API) InitSystem() {
api.Router.Handle("ping", api.ApiWebSocketHandler(ping))
}
func ping(req *model.WebSocketRequest) (map[string]interface{}, *model.AppError) {
data := map[string]interface{}{}
data["text"] = "pong"
data["version"] = model.CurrentVersion
data["server_time"] = model.GetMillis()
data["node_id"] = ""
return data, nil
}