vcastellm / guard-go

Run and restart go programs when changed
MIT License
24 stars 13 forks source link

go restful #8

Open drewwells opened 10 years ago

drewwells commented 10 years ago

I've been trying to use this to start/restart go-restful. I continue to get address is already bound errors when it restarts my app or I ctrl+d and restart guard-go myself.

22:48:28 - INFO - Running app.go...
22:48:28 - INFO - Started Go app, pid 14113
22:48:28 - INFO - Guard is now watching at '/Users/user/go/src/stash.rmn.com/perf/restify'
[1] guard(main)> 2014/03/20 22:48:29 [restful/swagger] listing is available at http://localhost:8080/apidocs.json
2014/03/20 22:48:29 [restful/swagger] http://localhost:8080/apidocs/ is mapped to folder ./swagger
2014/03/20 22:48:29 start listening on localhost:8080
22:48:43 - INFO - Running app.go...
22:48:43 - INFO - Started Go app, pid 14142
[1] guard(main)> 2014/03/20 22:48:45 [restful/swagger] listing is available at http://localhost:8080/apidocs.json
2014/03/20 22:48:45 [restful/swagger] http://localhost:8080/apidocs/ is mapped to folder ./swagger/
2014/03/20 22:48:45 start listening on localhost:8080
2014/03/20 22:48:45 listen tcp :9080: bind: address already in use
exit status 1
vcastellm commented 10 years ago

This could be caused by the old process being still running, probably a bug in the old process rip code.

Could you see your program still running when running ps uax?

mattes commented 10 years ago

same here

vcastellm commented 10 years ago

@mattes Could you see your program still running when running ps uax?

mrvdot commented 10 years ago

@victorcoder Having a similar problem, all the old processes are still running and I never see a 'Stopping Go...' message

mrvdot commented 10 years ago

As an update to this, here's the output of a 'ps aux' command after a single refresh:

➜  app git:(master) ✗ ps aux | grep 'go run'
alex.vanston    35088   0.0  0.0  2453264    692 s008  S+    3:22PM   0:00.00 grep go run
alex.vanston    35040   0.0  0.0  1402120   5028 s006  S+    3:22PM   0:00.10 go run app.go
alex.vanston    35039   0.0  0.0  2434388    496 s006  S+    3:22PM   0:00.00 sh -c cd /Users/alex.vanston/development/gopath/src/github.com/my/app && go run app.go &
alex.vanston    35015   0.0  0.0  1401992   5084 s006  S+    3:22PM   0:00.10 go run app.go
alex.vanston    35014   0.0  0.0  2443604    496 s006  S+    3:22PM   0:00.00 sh -c cd /Users/alex.vanston/development/gopath/src/github.com/my/app && go run app.go &

When I hit the server, it's still serving the original version.

Thanks for your help, Alex