Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watching files always detects changes #129

Closed
rodnaph opened this issue Oct 4, 2011 · 14 comments
Closed

Watching files always detects changes #129

rodnaph opened this issue Oct 4, 2011 · 14 comments

Comments

@rodnaph
Copy link

rodnaph commented Oct 4, 2011

I'm running forever like this...

$> forever -w server.js

But changes are always detected in all the files in my project, and the script is restarted once a second.

If there is a legitimate change in a file then only that file is listed as being changed, and forever correctly restarts the script. But if there are no changes then it reports all files as having changed and restarts the script.

I'm on OSX 10.6.8, using zsh, node 0.4.10, and npm versions...

├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected]

@indexzero
Copy link
Member

To my understanding you can use the .foreverignore file to control what files you would like to ignore from the watch list. @mmalecki would know more

@mmalecki
Copy link
Contributor

mmalecki commented Oct 4, 2011

Exactly what @indexzero said, you can just put some patterns into .foreverignore - files matching those pattern are ignored. Although, if if forever detect changes when no change happened, that's definitely a bug which I would love to hear more about.

@rodnaph
Copy link
Author

rodnaph commented Oct 4, 2011

Yes it detects changes when there are no changes. At first I thought maybe it was because I hadn't created a .foreverignore, but even creating one didn't change the behaviour.

If there's a way I can get you some more useful debugging info just let me know. Is it worth me doing any testing with the watch library?

@indexzero
Copy link
Member

Try this:

forever config set debug true

@rodnaph
Copy link
Author

rodnaph commented Oct 4, 2011

forever config set debug true
info: Running action: config
data: {
data: root: '/Users/rod/.forever',
data: pidPath: '/Users/rod/.forever/pids',
data: sockPath: '/Users/rod/.forever/sock',
data: columns: [
data: 'uid',
data: 'command',
data: 'script',
data: 'forever',
data: 'pid',
data: 'logfile',
data: 'uptime'
data: ]
data: }

No extra info in the terminal sorry, it just lists every file in my working copy (except those in .gitignore) and restarts the script. It then does the same thing once a second.

@mmalecki
Copy link
Contributor

mmalecki commented Oct 4, 2011

@rodnaph Classic checklist: can you try with v0.4.12? Can you try on some different shell, like bash?

@rodnaph
Copy link
Author

rodnaph commented Oct 5, 2011

I think I've tracked this down to a bug in watch, which i've opened a pull request on:

mikeal/watch#13

@indexzero
Copy link
Member

This has been resolved in watch: mikeal/watch#13 ... now waiting on the fix to get published to npm.

@geddski
Copy link

geddski commented Nov 2, 2011

I'm getting this same issue. Wonder what the hold up is for publishing to npm.

@indexzero
Copy link
Member

@GEDDesign the fix is published to npm. Have you reinstalled forever yet? Dependencies won't update themselves ;)

@geddski
Copy link

geddski commented Nov 3, 2011

@indexzero cool you're right, watch 0.4.0 has been published to npm. I reinstalled forever but it still brought down watch 0.3.3. I submitted a pull request for updating the dependency version.

I manually replaced forever's watch with the latest and --watch still doesn't do anything. I can create another separate issue for that.

@mmalecki
Copy link
Contributor

OK, can anyone with such issue provide me SSH access? I can't reproduce it neither on OS X nor Linux.

@geddski
Copy link

geddski commented Nov 22, 2011

all is working now with [email protected]. This issue may remain closed.

@mmalecki
Copy link
Contributor

Yay! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants