Skip to content
  • Carlos Garnacho's avatar
    libtracker-miner: Clean up TrackerMonitor · 3bc295d2
    Carlos Garnacho authored
    We used to implement our own caching and timeout mechanism on top
    of GIO's, and our own "blacklisting" that would merge or transform
    events depending on the previouly cached content.
    
    This adds quite some extra latency in some cases on top of
    GFileMonitor's rate (up to 2s), and even in some cases do produce
    mistaken results (CREATE(a)+MOVE(a->b) != CREATE(b) if you are rewriting
    a file, but how can TrackerMonitor know).
    
    The code has been simplified in various fronts:
    - (Almost) no event caching. Only CREATED/UPDATED events are possibly
      cached awaiting for the CHANGES_DONE_HINT that must follow them.
    - No event manipulation nor merging. GFileMonitor does a good job at
      being truthful, and the upper layers do know better how to coalesce
      events into a more reduced set of equivalent tasks, since there's
      further info like file state in the database.
    - The deprecated SEND_MOVED flag has been replaced by WATCH_MOVES. The
      MOVED_IN/MOVED_OUT/RENAMED events can be handled in a simpler way each
      than the deprecated MOVED event.
    
    Overall this makes TrackerMonitor slightly more verbose (but still
    consistent wrt sending a meaninful sequential set of changes), but more
    reactive overall, since we now solely rely on GFileMonitor rate limits.
    
    With this change, TrackerMinerFS is left as the only place that does
    coalescing of events.
    3bc295d2