JT703
JT703

Reputation: 1311

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?

Upvotes: 7

Views: 1449

Answers (4)

kakadais
kakadais

Reputation: 491

I like to use develop mode for small-mid project as well, saving files to /public is terrible idea.

Recommand Meteor-Files Save all files like json data into the mongodb or s3, and use it like the file you have in local.

Upvotes: 0

JT703
JT703

Reputation: 1311

I ended up exporting the file to an S3 bucket so that it didn't effect the Meteor watching.

Upvotes: 0

Rawdreeg
Rawdreeg

Reputation: 461

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

Upvotes: 1

Thierry
Thierry

Reputation: 339

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

Upvotes: 2

Related Questions