mirror of
https://github.com/go-gitea/gitea
synced 2025-09-28 03:28:13 +00:00
feat: optimize log indexes
This commit is contained in:
@@ -186,8 +186,11 @@ func (s *Service) UpdateLog(
|
||||
return nil, status.Errorf(codes.Internal, "write logs: %v", err)
|
||||
}
|
||||
task.LogLength += int64(len(rows))
|
||||
if task.LogIndexes == nil {
|
||||
task.LogIndexes = &bots_model.LogIndexes{}
|
||||
}
|
||||
for _, n := range ns {
|
||||
task.LogIndexes = append(task.LogIndexes, task.LogSize)
|
||||
*task.LogIndexes = append(*task.LogIndexes, task.LogSize)
|
||||
task.LogSize += int64(n)
|
||||
}
|
||||
if err := bots_model.UpdateTask(ctx, task, "log_indexes", "log_length", "log_size"); err != nil {
|
||||
|
Reference in New Issue
Block a user