Handle error returned by GetClusterInfos() (#30919)
A recent change to the enterprise cluster code introduced a change to the enterprise API interface. GetClusterInfos() can now return an error. This commit introduces code to handle that error.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
dfe6478fd7
Коммит
4b64eb0e39
@@ -131,14 +131,11 @@ func (a *App) GetLogsSkipSend(rctx request.CTX, page, perPage int, logFilter *mo
|
||||
return a.Srv().GetLogsSkipSend(rctx, page, perPage, logFilter)
|
||||
}
|
||||
|
||||
func (a *App) GetClusterStatus(rctx request.CTX) []*model.ClusterInfo {
|
||||
infos := make([]*model.ClusterInfo, 0)
|
||||
|
||||
if a.Cluster() != nil {
|
||||
infos = a.Cluster().GetClusterInfos()
|
||||
func (a *App) GetClusterStatus(rctx request.CTX) ([]*model.ClusterInfo, error) {
|
||||
if a.Cluster() == nil {
|
||||
return make([]*model.ClusterInfo, 0), nil
|
||||
}
|
||||
|
||||
return infos
|
||||
return a.Cluster().GetClusterInfos()
|
||||
}
|
||||
|
||||
func (s *Server) InvalidateAllCaches() *model.AppError {
|
||||
|
||||
Ссылка в новой задаче
Block a user