Fix file info index batch (#17525)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3d6e69b002
Коммит
757ea36211
@@ -101,7 +101,7 @@ func (fs SqlFileInfoStore) Save(info *model.FileInfo) (*model.FileInfo, error) {
|
||||
|
||||
func (fs SqlFileInfoStore) GetByIds(ids []string) ([]*model.FileInfo, error) {
|
||||
query := fs.getQueryBuilder().
|
||||
Select(append(fs.queryFields, "P.ChannelId")...).
|
||||
Select(append(fs.queryFields, "COALESCE(P.ChannelId, '') as ChannelId")...).
|
||||
From("FileInfo").
|
||||
LeftJoin("Posts as P ON FileInfo.PostId=P.Id").
|
||||
Where(sq.Eq{"FileInfo.Id": ids}).
|
||||
@@ -441,7 +441,7 @@ func (fs SqlFileInfoStore) Search(paramsList []*model.SearchParams, userId, team
|
||||
return nil, err
|
||||
}
|
||||
query := fs.getQueryBuilder().
|
||||
Select(append(fs.queryFields, "P.ChannelId as ChannelId")...).
|
||||
Select(append(fs.queryFields, "Coalesce(P.ChannelId, '') AS ChannelId")...).
|
||||
From("FileInfo").
|
||||
LeftJoin("Posts as P ON FileInfo.PostId=P.Id").
|
||||
LeftJoin("Channels as C ON C.Id=P.ChannelId").
|
||||
@@ -627,7 +627,7 @@ func (fs SqlFileInfoStore) CountAll() (int64, error) {
|
||||
func (fs SqlFileInfoStore) GetFilesBatchForIndexing(startTime, endTime int64, limit int) ([]*model.FileForIndexing, error) {
|
||||
var files []*model.FileForIndexing
|
||||
sql, args, _ := fs.getQueryBuilder().
|
||||
Select(append(fs.queryFields, "p.ChannelId")...).
|
||||
Select(append(fs.queryFields, "Coalesce(p.ChannelId, '') AS ChannelId")...).
|
||||
From("FileInfo").
|
||||
LeftJoin("Posts AS p ON FileInfo.PostId = p.Id").
|
||||
Where(sq.GtOrEq{"FileInfo.CreateAt": startTime}).
|
||||
|
||||
Ссылка в новой задаче
Block a user