I restart node.js server with forever by watchin files. Every few minutes I get message:
error: restarting script because .git/FETCH_HEAD changed
which restarts my server.
How to avoid that? It shall restart upon file change not git head change.
Watching script:
HOME=/root forever \
--pidFile $PIDFILE \
-a \
-l $LOGFILE \
--minUptime $MIN_UPTIME \
--spinSleepTime $SPIN_SLEEP_TIME \
--watch \
--watchDirectory=$APPLICATION_PATH \
start $APPLICATION_PATH$APPLICATION_SCRIPT 2>&1 > /dev/null &
RETVAL=$?
log_end_msg $RETVAL
Use the watchIgnore
directive to ignore your .git folder, just add this option :
--watchIgnore "**/.git/**"
see #20 comment in: https://github.com/foreverjs/forever/issues/235
this problem is not solved in forever, works for many, fail for others. many developers fixed but 'cause is a pull request without tests still not merging yet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With