Reputation: 291
I have made my speech recognizer server with nodejs, but it happens that I have a tiny memory leak in each recognition that is driving me crazy. While I am fixing this problem I want to use the actual version. To do that I am thinking in a routine, that restarts the nodejs at given time.
How can I do that?
Upvotes: 0
Views: 62
Reputation: 291
This can accomplish part of almost of I want. Using .bat file, the one possible solution could be:
@echo off
REM nodevars.bat directory
:loop
cd C:\Program Files (x86)\nodejs
call nodevars.bat
::PAUSE
cd C:\app_directory
::PAUSE
REM Initialize nodejs server
start node app.js
::node app.js ::equivalent
REM do the timeout
timeout /t 5 > null REM 5 seconds
taskkill /f /im node.exe >null
REM safety close
timeout /t 2 >null REM 2 Seconds
goto loop
Upvotes: 0
Reputation: 4469
try nodemon
npm install -g nodemon --save
then start ur app as nodemon app.js
Upvotes: 1