Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 886 Bytes

README.md

File metadata and controls

25 lines (17 loc) · 886 Bytes

Restart

go install

https://github.com/Petelin/restart

use in command

go install github.com/Petelin/restart/restart

then use restart "<bash command>"

this is equal to run bash -c "<bash command>" but with auto restart if command exit.

What is it?

Main idea is create a subprocess to run the real job. the main process monitor it, restart it if err happen, or kill it after a while. Add what ever you what from this idea.

Why we need this?

we all know write a nevery stoped program is almost impossiple. if we can promiss our program(like a spider) can work for a wheal, then we restart it if it crash, that will make us happy.

If you want more, you can use something else like supervisor

but i just want a simple main bin file.

Add feature your self. like ......

You can write a Runxxx function, i like to merge your RP. enjoy!