Persist lein pids as hidden project files
This will allow us to shutdown the processes when restarting Cuttle if it crashes or a user exits.
on load:
- check if each project has a
.cuttle-lein-pid - kill the process
- remove pid file
This is an excellent idea and should simplify the shutdown code.
On Thursday, January 29, 2015, Shaun LeBron [email protected] wrote:
This will allow us to shutdown the processes when restarting Cuttle if it crashes or a user exits.
on load:
- check if each project has a .cuttle-lein-pid
- kill the process
- remove pid file
— Reply to this email directly or view it on GitHub https://github.com/oakmac/cuttle/issues/83.
On second thought - it would be a really bad idea to persist pids after the application crashes. You run the risk of cancelling the pid of some other process when restarting Cuttle. But in general I like this idea while the application is running to simplify the shutdown code.
We can inspect pids to be sure they are running lein with-profile +cuttle. And also it will keep us from have multiple Cuttle instances from trying to build the same project, though that's only really possible when running a release version alongside a dev version.