waicool20 / KAGA

Kancolle Auto Gui App or Kaga - A GUI for the tool over here: https://github.com/mrmin123/kancolle-auto and https://github.com/mrmin123/kcauto-kai
GNU General Public License v3.0
20 stars 3 forks source link

Process Watcher #5

Closed silfumus closed 7 years ago

silfumus commented 7 years ago

Hello, Are there any plan to add function to watch kancolle-auto process and restart it as necessary? It's pretty useful in case of unexpected crash or dealing with unstable connection.

Either way, thanks for your application!

waicool20 commented 7 years ago

Sure I could add something like that, though I may need several examples of KCAuto logs when it crashes so KAGA can properly detect it actually crashed and not self terminated

waicool20 commented 7 years ago

@silfumus can you post me some logs leading to a crash and their cause, so I can try and detect which situation it is

silfumus commented 7 years ago

Sorry, couldn't provide logs since kc-auto (and the setup) has been stable and rarely crashes nowadays.

After playing with KAGA for a few times, I noticed that it tracks kc-auto process whether it's running or not. Couldn't it just deduce from that whether to restart kc-auto or not?

waicool20 commented 7 years ago

Well, it can detect when the program starts and stops, but it can't really tell if it exited gracefully (eg. scheduled stop) so I was thinking of making a log monitor of some sort to check if it crashed or not. I could try using the exit value as as quick way, but I'd like to tell apart crash types in preparation of mobile notifications ;)

waicool20 commented 7 years ago

Should be somewhat working right now as of v1.2.0 or commit 868fbe71fdab6f7fcab74d93aae9993c91003c84

Just using the exit value right now, but maybe more specific in the future by examining the logs!