The use of `watchfiles` breaks changes detection on NFS
I'm not sure yet what's the culprit of the problem, but in my case, fava exposes a ledger mounted into a pod via NFS, and another pod runs periodically and imports new transactions into the ledger. Unfortunately, more often than not, these changes aren't picked up by Fava. This is not a matter of multiple copies of NFS mounts - if I go to edit the files in Fava, the changes are there. They simply aren't reflected in the journal and reports - so it must be Fava not reloading the ledger's files.
I think it's a problem with watchfiles, since up until recently everything worked perfectly. I can't be 100% sure though, as I also made a switch from Docker to k8s, so that might have something to do with the issue (though in both cases, I mount the same NFS share with the same options, so I doubt that's the issue).
I verified that the old watcher works as expected, and created a new flag (--poll-watcher) that can be used to tell fava to use the old watcher instead of the new one (PR #1850)
More info: seems like it is, indeed, an issue with the Notify library that's used by watchfiles: see here: https://github.com/notify-rs/notify/issues/384#issuecomment-1030934574
The reason it used to work for my Docker setup, but now doesn't work as expected on my k8s setup is that with Docker, there was a single NFS mount shared by all the containers. Whereas in my k8s setup, the containers are separated into different pods, and the NFS volume is potentially mounted several times by separate nodes.
Thanks for adding the option to switch to the polling watcher to workaround this issue, closing this one.