cuttle icon indicating copy to clipboard operation
cuttle copied to clipboard

Persist lein pids as hidden project files

Open shaunlebron opened this issue 10 years ago • 3 comments

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

shaunlebron avatar Jan 29 '15 07:01 shaunlebron

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.

oakmac avatar Jan 29 '15 09:01 oakmac

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.

oakmac avatar Jan 29 '15 11:01 oakmac

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.

shaunlebron avatar Jan 29 '15 14:01 shaunlebron