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

Keeps restarting server all the time #36

Closed
senior-php-developer opened this issue Aug 22, 2011 · 7 comments
Closed

Keeps restarting server all the time #36

senior-php-developer opened this issue Aug 22, 2011 · 7 comments

Comments

@senior-php-developer
Copy link

When editing file and uploading that back through FTP, nodemon recognizes the change and keeps restarting forever
unless I explicitly do touch filename

@remy
Copy link
Owner

remy commented Aug 22, 2011

Can you confirm that the account you run nodemon under is the same and has the permissions as that one that you're uploading with FTP?

@senior-php-developer
Copy link
Author

I've set permissions to file 777
it still restarts each time

On 8/22/2011 3:43 PM, remy wrote:

Can you confirm that the account you run nodemon under is the same and has the permissions as that one that you're uploading with FTP?

@MartinodF
Copy link

I'm having the same problem (node v0.6.5). Editing files remotely via SFTP (but I don't think that matters), and whenever I change the first file nodemon just keeps restarting the app. File permissions are correct.

I was able to fix it by changing nodemon to write a single character 'a' to the flag file instead of an empty string ''. Reading node's source code, this behavior seems to be correct (or maybe I don't understand how nodemon is supposed to work). fs.writeSync() contains the following line:

if (!length) return 0;

So if the write buffer length is zero, the file isn't touched at all.

Maybe you could consider using fs.utimesSync(), introduced in node v0.5.0, and falling back on exec('touch ...') if that's not available?

@remy
Copy link
Owner

remy commented Jan 10, 2012

@MartinodF that totally makes sense - but I'd rather not use touch to try to start thinking about adding decent windows support. I think the quickest and simplest fix is just to insert a character as you suggested. Watch this space (hopefully not too much longer - sorry!)

@remy
Copy link
Owner

remy commented Jan 11, 2012

I've now removed the dependancy on the .monitor file altogether in the latest release. Please could you update and test? Should be all good now (finally!)

@remy remy closed this as completed Jan 11, 2012
@MartinodF
Copy link

Works perfectly! Great work, thanks

@remy
Copy link
Owner

remy commented Jan 11, 2012

@MartinodF Pleased to hear :)

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

No branches or pull requests

3 participants