MM-39690: Clean up some unnecessary logs (#20368)
These logs would appear at every request and didn't have any useful info for the admin. It was more of a developer logging thing and therefore removing it. https://mattermost.atlassian.net/browse/MM-39690 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ce84a5d190
Коммит
319a2b2428
@@ -442,7 +442,6 @@ func TestSearchFilesInTeamForUser(t *testing.T) {
|
||||
|
||||
es := &mocks.SearchEngineInterface{}
|
||||
es.On("SearchFiles", mock.Anything, mock.Anything, page, perPage).Return(resultsPage, nil)
|
||||
es.On("GetName").Return("mock")
|
||||
es.On("Start").Return(nil).Maybe()
|
||||
es.On("IsActive").Return(true)
|
||||
es.On("IsSearchEnabled").Return(true)
|
||||
@@ -471,7 +470,6 @@ func TestSearchFilesInTeamForUser(t *testing.T) {
|
||||
|
||||
es := &mocks.SearchEngineInterface{}
|
||||
es.On("SearchFiles", mock.Anything, mock.Anything, page, perPage).Return(resultsPage, nil)
|
||||
es.On("GetName").Return("mock")
|
||||
es.On("Start").Return(nil).Maybe()
|
||||
es.On("IsActive").Return(true)
|
||||
es.On("IsSearchEnabled").Return(true)
|
||||
|
||||
@@ -1464,7 +1464,6 @@ func TestSearchPostsForUser(t *testing.T) {
|
||||
|
||||
es := &mocks.SearchEngineInterface{}
|
||||
es.On("SearchPosts", mock.Anything, mock.Anything, page, perPage).Return(resultsPage, nil, nil)
|
||||
es.On("GetName").Return("mock")
|
||||
es.On("Start").Return(nil).Maybe()
|
||||
es.On("IsActive").Return(true)
|
||||
es.On("IsSearchEnabled").Return(true)
|
||||
@@ -1492,7 +1491,6 @@ func TestSearchPostsForUser(t *testing.T) {
|
||||
|
||||
es := &mocks.SearchEngineInterface{}
|
||||
es.On("SearchPosts", mock.Anything, mock.Anything, page, perPage).Return(resultsPage, nil, nil)
|
||||
es.On("GetName").Return("mock")
|
||||
es.On("Start").Return(nil).Maybe()
|
||||
es.On("IsActive").Return(true)
|
||||
es.On("IsSearchEnabled").Return(true)
|
||||
|
||||
@@ -7243,10 +7243,6 @@
|
||||
"id": "ent.elasticsearch.stop.already_stopped.app_error",
|
||||
"translation": "Elasticsearch is already stopped."
|
||||
},
|
||||
{
|
||||
"id": "ent.elasticsearch.test_config.connect_failed",
|
||||
"translation": "Connecting to Elasticsearch server failed."
|
||||
},
|
||||
{
|
||||
"id": "ent.elasticsearch.test_config.indexing_disabled.error",
|
||||
"translation": "Elasticsearch is disabled."
|
||||
|
||||
@@ -32,7 +32,6 @@ func (s SearchFileInfoStore) indexFile(file *model.FileInfo) {
|
||||
mlog.Error("Encountered error indexing file", mlog.String("file_info_id", file.Id), mlog.String("search_engine", engineCopy.GetName()), mlog.Err(err))
|
||||
return
|
||||
}
|
||||
mlog.Debug("Indexed file in search engine", mlog.String("search_engine", engineCopy.GetName()), mlog.String("file_info_id", file.Id))
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -46,7 +45,6 @@ func (s SearchFileInfoStore) deleteFileIndex(fileID string) {
|
||||
mlog.Error("Encountered error deleting file", mlog.String("file_info_id", fileID), mlog.String("search_engine", engineCopy.GetName()), mlog.Err(err))
|
||||
return
|
||||
}
|
||||
mlog.Debug("Removed file from the index in search engine", mlog.String("search_engine", engineCopy.GetName()), mlog.String("file_info_id", fileID))
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -172,7 +170,6 @@ func (s SearchFileInfoStore) Search(paramsList []*model.SearchParams, userId, te
|
||||
mlog.Error("Encountered error on Search.", mlog.String("search_engine", engine.GetName()), mlog.Err(appErr))
|
||||
continue
|
||||
}
|
||||
mlog.Debug("Using the first available search engine", mlog.String("search_engine", engine.GetName()))
|
||||
|
||||
// Get the files
|
||||
filesList := model.NewFileInfoList()
|
||||
@@ -191,10 +188,8 @@ func (s SearchFileInfoStore) Search(paramsList []*model.SearchParams, userId, te
|
||||
}
|
||||
|
||||
if *s.rootStore.getConfig().SqlSettings.DisableDatabaseSearch {
|
||||
mlog.Debug("Returning empty results for file Search as the database search is disabled")
|
||||
return model.NewFileInfoList(), nil
|
||||
}
|
||||
|
||||
mlog.Debug("Using database search because no other search engine is available")
|
||||
return s.FileInfoStore.Search(paramsList, userId, teamId, page, perPage)
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ func (s SearchPostStore) indexPost(post *model.Post) {
|
||||
mlog.Warn("Encountered error indexing post", mlog.String("post_id", post.Id), mlog.String("search_engine", engineCopy.GetName()), mlog.Err(err))
|
||||
return
|
||||
}
|
||||
mlog.Debug("Indexed post in search engine", mlog.String("search_engine", engineCopy.GetName()), mlog.String("post_id", post.Id))
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -46,7 +45,6 @@ func (s SearchPostStore) deletePostIndex(post *model.Post) {
|
||||
mlog.Warn("Encountered error deleting post", mlog.String("post_id", post.Id), mlog.String("search_engine", engineCopy.GetName()), mlog.Err(err))
|
||||
return
|
||||
}
|
||||
mlog.Debug("Removed post from the index in search engine", mlog.String("search_engine", engineCopy.GetName()), mlog.String("post_id", post.Id))
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -185,16 +183,13 @@ func (s SearchPostStore) SearchPostsForUser(paramsList []*model.SearchParams, us
|
||||
mlog.Warn("Encountered error on SearchPostsInTeamForUser.", mlog.String("search_engine", engine.GetName()), mlog.Err(err))
|
||||
continue
|
||||
}
|
||||
mlog.Debug("Using the first available search engine", mlog.String("search_engine", engine.GetName()))
|
||||
return results, err
|
||||
}
|
||||
}
|
||||
|
||||
if *s.rootStore.getConfig().SqlSettings.DisableDatabaseSearch {
|
||||
mlog.Debug("Returning empty results for post SearchPostsInTeam as the database search is disabled")
|
||||
return &model.PostSearchResults{PostList: model.NewPostList(), Matches: model.PostSearchMatches{}}, nil
|
||||
}
|
||||
|
||||
mlog.Debug("Using database search because no other search engine is available")
|
||||
return s.PostStore.SearchPostsForUser(paramsList, userId, teamId, page, perPage)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user