watcher icon indicating copy to clipboard operation
watcher copied to clipboard

SetMaxEvents limits the event creation for files

Open aditi-plivo opened this issue 5 years ago • 1 comments

@radovskyb As a solution for High CPU usage for polling large directories to monitor Create/Move events watch.FilterOps(watcher.Create, watcher.Move)

We tried the following things:

  • increasing the polling duration (#24) (as we could avoid real time events notifications)

  • reducing the event per watch cycle by setting the max events w.SetMaxEvents(5000)

But SetMaxEvents is not working as expected, as the files which are left after 5000 files are left as it is, once more files are created the watcher will again pickup random 5000 files to create events and the left over files are never picked up for event creation.

Would like to know if we misunderstood the use case for SetMaxEvents or using it in a wrong way

aditi-plivo avatar Sep 08 '20 07:09 aditi-plivo

Facing the same issue. Even when I set the polling to 1 ms, it still misses some files, even though I have not set any SetMaxEvents at all.

rizwankh avatar Sep 15 '22 11:09 rizwankh