fix(search): added comment for TrashItem event processing

This commit is contained in:
Alex Ababii committed 2026-12-03 17:33:47 +01:00
1 parent db6f2e37dc
commit 380783baff
1 file changed
+4
@@ -176,6 +176,7 @@ func (s Service) nakWithDelay(e *raw.Event, id *provider.StorageSpaceId, delay t
s.log.Error().Err(err).Interface("spaceID", id).Msg("failed to get the delivery count of the event, giving up on it")
return e.Ack()
}
// NumDelivered also counts redeliveries caused by an expired ack wait
if n >= s.maxIndexRuns {
s.log.Warn().Interface("spaceID", id).Uint64("deliveries", n).Msg("the space still has files indexed by name only, run `opencloud search index` to retry them once tika is back")
return e.Ack()
@@ -206,6 +207,9 @@ func (s Service) processEvent(e raw.Event) error {
switch ev := e.Event.Event.(type) {
case events.ItemTrashed:
// A redelivered event (after NakWithDelay) replays all of processEvent, not just the debounce,
// so TrashItem runs again without a stat. A file restored in the meantime stays marked as
// deleted until the next walk fixes it.
s.index.TrashItem(ev.ID)
debounce(getSpaceID(ev.Ref), false)
case events.ItemPurged: