Node.js as a server script

Possible Duplicate:
How to exit in Node.JS

I'm using node.js to import some data in the background and I'll have the script running every other day in the background using cron. I don't need it to listen. How do I exit the node script after it runs? Should I use process.exit() or is there a better way?


If its not bound to a database or listing on a port it will automatically close. If you are connected to a database and need to shut down the process then use process.exit(); after cleaning up the connections etc..

链接地址: http://www.djcxy.com/p/52708.html

上一篇: 如何在退出时终止所有子进程?

下一篇: Node.js作为服务器脚本