-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Param: ignore_watch doesn't work on .git folder #1288
Comments
Hi, Just tested on osx and same nodejs/pm2 versions. Played with Could you provide a sample of your |
Hi,
The line "Change detected..." is printed when .git/FETCH_HEAD is updated. I have found a workarround: I have moved the source code to another directory and sync with the app directory when there are new commits. |
I played with Could you give me the debug output by doing:
What I'm interested in are those lines:
|
Hi,
I've been testing, and it seems that if I modify a file (manually), App isn't reload, it is as if the watch wasn't working (except for FETCH_HEAD git, just what I don't want ...) |
Thanks, everything seems to be fine :|. |
Ouh! forget the last comment, it was my mistake; but I still get the same problem with ".git/FETCH_HEAD" :/ I found a workarround: I'm using a directory for build and other for deploy (without .git), and I manage when deploy dir must be sync. Thanks for your time. |
Other related question. If I start pm2 with the 'processes.json' above, which is the scope of pm2-watch? |
I haven't understand your question, by scope are you talking about the working directory?
|
Yes, I'm talking about the app directory. I've specified a "cwd" but it doesn't work. |
Could you paste your What is your osx version? On osx you'll be using FSEvents, so you could try to disable them:
|
My version is 10.10.3 {
"apps" : [{
"name" : "myapp",
"script" : "bin/www",
"cwd" : "/Users/crico/Workspaces/myapp",
"watch" : true,
"ignore_watch" : ["[\\/\\\\]\\./", "node_modules"],
"watch_options": {
"followSymlinks": false,
"useFsEvents": false
},
"log_date_format" : "YYYY-MM-DD HH:mm Z",
"merge_logs" : true
}]
} |
Finally, I discovered that my problem is in the "script" parameter. If I use the param: "script" : "bin/www", watch doesn't work, but instead I use: "script" : "app.js", watch works rightly. In both cases, I've launched pm2 from the root directory of my app: |
I'm using the
The arg value is a regex string. After that, watch would successfully ignore changes to the .git folder, avoiding such restart errors as: "Change detected on path .git/index.lock for app [app_name] - restarting" |
I have the below start-script (processes.json):
when I start the app with the command: pm2 start processes.json, I see that the app is restarted every time that file: ".git/FETCH_HEAD" is updated.
I test with:
"ignore_watch" : [".git", "node_modules"]
or
"ignore_watch" : [".git/FETCH_HEAD", "node_modules"]
with the same result.
Versions:
pm2 0.12.15
node v0.12.3
npm 2.9.1
What could be the problem?
Regards!
The text was updated successfully, but these errors were encountered: