stephenh / mirror

A tool for real-time, two-way sync for remote (e.g. desktop/laptop) development
Apache License 2.0
391 stars 37 forks source link

ignoring directories with many files #50

Closed nathantsoi closed 4 years ago

nathantsoi commented 4 years ago

Hey @stephenh, thx again for all your work on this tool!

I have been running into an issue when I try to sync a directory with lots of files on the server. For example, if I have a data directory with a bunch of files, then starting the client, hangs for a while and I eventually get a DEADLINE_EXCEEDED error. This directory is in the .gitignore file, but even so, it seems that watchman or something on the server is hanging trying to list all the files in this directory. Would it be possible to ignore this directory wherever it's hanging?

I'd be happy to try to fix this, if you could point me in the right direction?

Thanks!

nathantsoi commented 4 years ago

after a big of debugging, i found a fix! i added a .watchmanconfig with:

{
    "ignore_dirs": [
        "data",
    ]
}

in the root of my project and restarting watchman with: watchman watch-del-all

we can then check if the file is ignored (or not) with: watchman --server-encoding=json --persistent log-level off after running mirror server

stephenh commented 4 years ago

Ah great, nice find! I've added a note about that to the readme. Thanks for reporting what you found.