Skip to content
This repository

Don't watch public directory for changes. See #894 #895

Closed
wants to merge 1 commit into from

4 participants

Mitar Brian Lomeland Christian Stewart James Gill
Mitar
mitar commented

I made a simple change to not watch public directory for changes. I do not see a reason why it should be watched, but it prevents server restarting when new files are added to public directory. See #894 for more details.

Brian Lomeland

@mitar Doesn't changing ignore_files have the side effect of breaking the bundler and deploy commands? This will exclude files in public from being bundled or deployed.

Mitar
mitar commented

From comments and the code I saw (but have not done thorough check) this only influences what is watched, no?

Christian Stewart

You would want it to refresh when the public changes because of images :)

Mitar
mitar commented

You mean, I would maybe want to reload the page because of the images? So that it is not necessary to reload the page manually in the browser?

James Gill

I definitely like that it reloads on changes to public files. Not only is it a development convenience, but I also like knowing that in production, when I make a change, it's hot-reloaded to connected clients.

Christian Stewart

Okay here's what this SHOULD do and this pull does NOT address this:

We need a system to define special folders in Meteor.

  1. System to define a static folder (no hotloading no compiling bundled as static but unpublished folder)
  2. System to define non-reloading public subdirectories

Oftentimes I want to use this to have a secure downloads folder. Right now, I have something I would author into a package if it wasn't so damn hacky, but on startup (assuming it's bundled to heroku's ephemeral filesystem) it moves the secure files folder out of public (because .zip etc are deleted from bundle if not in public) so it is not served. Then, files are copied temporarily to temporary folders (random string subdir) in public for temporary downloads. Works quite well! Though I could make a package to do this, though, it doesn't seem like a very good solution and I'm sure they will come up with something better for it.

Mitar
mitar commented

OK. I now see that was a bad idea to store things into public, because it tries to bundle it. So for now I moved things under .meteor and I do:

__meteor_bootstrap__.app.use('/pdf', connect.static(Storage._storageDirectory, {maxAge: 24 * 60 * 60 * 1000, redirect: false}))
Mitar
mitar commented

I didn't really get the symlink trick to work. If I made symlink from /public/pdf/ to /.meteor/pdf/, it still tried to bundle everything.

Mitar
mitar commented

I am closing this.

Mitar mitar closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Mar 31, 2013
Mitar mitar Don't watch public directory for changes. See #894 97172f5
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. +2 1  app/lib/bundler.js
3  app/lib/bundler.js
@@ -49,7 +49,8 @@ var ignore_files = [
49 49 /~$/, /^\.#/, /^#.*#$/,
50 50 /^\.DS_Store$/, /^ehthumbs\.db$/, /^Icon.$/, /^Thumbs\.db$/,
51 51 /^\.meteor$/, /* avoids scanning N^2 files when bundling all packages */
52   - /^\.git$/ /* often has too many files to watch */
  52 + /^\.git$/, /* often has too many files to watch */
  53 + /^public$/ /* so that public files can be changed without restarting the server */
53 54 ];
54 55
55 56 ///////////////////////////////////////////////////////////////////////////////

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.