jgunthorpe / cloud_mdir_sync

Download mailboxes from the cloud into a local MailDir
Other
16 stars 9 forks source link

Watchdog #21

Open wang2357 opened 1 month ago

wang2357 commented 1 month ago

Use watchdog instead of pyinotify for maildir changes monitoring. The benefit is that the program can be used in other platforms.

jgunthorpe commented 1 month ago

It is probably reasonable to have a polling approach for macos since it can't use Linux inotify if there is no better alternative, but you shouldn't remove the linux inotify code, it is much better as you noted in another thread..

wang2357 commented 3 weeks ago

The watchdog package is event driven on MacOS and uses inotify on Linux. So it has excellent performance on both platform. The earlier comment I made on watchdog was due to incorrect asyncio calls (basically the watchdog callback needs to be run in the same event loop as the main thread - otherwise the synchronization using needs_update signal is messed up). I have since removed this bug, and the extra delay on Mac due to this bug has been removed. I do not notice any performance degradation with the new code. So please look at the code again to see if it is acceptable.

wang2357 commented 3 weeks ago

There is a new issue, where the Push notification is no longer working, due to Microsoft removing legacy API. However, that is a totally separate issue. The changes from local to remote due to file changes are detected immediately and updated to cloud immediately.

jgunthorpe commented 4 days ago

Ok, I will try to test it