I am building an app that stores user generated images. These images get used throughout the app in a gallery type view. They also update/regenerate frequently.
The problem I am having is when a new image gets generated, I am storing it in the public directory. This causes the meteor server to "restart".
Is there a way to turn off file watching?
I don't think it is possible as for now
Even if you could stop to watch it would not solve your issue
When meteor detect a change it rebuild the server (.meteor/local/build/) and serve it from there.
Public folder is sent there : ".meteor/local/build/static/"
In a case where you would stop watching for updates you would also stop to see changes in what your client can access.
I found out that this particular case can be solved by replacing meteor by another tool to deal with static assets.
I have a meteor app to deal with data and file sync, but I also keep an Apache to serve as a file distribution manager.
My meteor app keep small, assets can be sent somewhere else (Ex.: S3 when you get in production).
I just found an answer on a similar question on this website that I think might help if you haven't found a solution yet.
I finally found a workaround. I'm putting everything in /public/lib/. Then, line 286 of /usr/lib/meteor/app/run.js, I'm adding the folder I don't want Meteor to watch: self.exclude_paths = [ path.join(app_dir, '.meteor', 'local'), path.join(app_dir, 'public', 'lib') ]; This way I can have as much files as I want in lib, and they don't slow everything down. include path is '/lib/dojo/dojo.js'.
by Mathieu
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With