When bringing up the “ANSVR Solve Options” dialog box, after you click on the “Start” button, every 2 seconds SGP sends GET /api/config HTTP/1.1 to the ANSVR server.
What is SGP expecting back from the ANSVR server?
My Server Status remains DOWN but the server is still pinged every 2 seconds.
If I click on the gear icon to the right of the “Server URL”, it brings up the ansvr configuration we b page.
The “DOWN” indication was a bug on my part (I’ve been improving the ANSVR code). Sorry for the wild goose chase there.
What does SGP do when the ANSRV “Restart” button is pressed?
It appears to call stop_ansvr.bat and start_ansvr.bat at the same time, or maybe stop_ansvr.bat but not wait for it to complete, then call start_ansvr.bat. The result is that 50+% of the time ANSRV fails to properly start. I added a “pause” statement at the end of both script and clearly see both running at the same time.
It’s certainly easy enough to increase the delay, but, at the same time it should not be possible to see them running at the same time. Ideally we would just wait until we no longer receive a response from the server
It’s not waiting, OR the script is putting itself in the background and the parent is executing, but I suspect DOS batch files can’t do that like UNIX shell scripts can.
If you have ansvr installed and you ever get bored, append pause to the end of the file and then click on the SGP “Restart” button. You’ll see the ansvr_stop.bat and ansvr_start.bat CMD windows appear.
Given that the “Stop” and “Start” buttons work fine, I’d put this low on the priority list, unless SGP supports other scripts that use the same functionality as AnsvrRunAction, and those other scripts are designed to wait for the process to finish.