Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn off file watching in Meteor

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?

like image 790
JT703 Avatar asked Apr 10 '13 20:04

JT703


2 Answers

  1. I don't think it is possible as for now

  2. 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).

like image 141
Thierry Avatar answered Nov 09 '22 17:11

Thierry


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

like image 42
Rawdreeg Avatar answered Nov 09 '22 17:11

Rawdreeg