(err error, phase string)
| 150 | } |
| 151 | |
| 152 | func (r *ReindexService) failWithError(err error, phase string) (*ReindexProgress, error) { |
| 153 | r.mu.Lock() |
| 154 | now := time.Now() |
| 155 | r.progress.Status = "failed" |
| 156 | r.progress.Phase = phase |
| 157 | r.progress.CompletedAt = &now |
| 158 | r.progress.Errors = append(r.progress.Errors, err.Error()) |
| 159 | r.mu.Unlock() |
| 160 | |
| 161 | logrus.WithError(err).WithField("phase", phase).Error("Reindex operation failed") |
| 162 | return r.GetProgressPtr(), err |
| 163 | } |
| 164 | |
| 165 | func (r *ReindexService) dropCollections(ctx context.Context) error { |
| 166 | r.updateProgress("drop_collections", 0, 0) |
no test coverage detected