refactor(core): add headless run and auto-restart
- Run without console by default - Log to file once console hidden - Recover panics in background goroutines - Restart agent after unexpected errors - Use shared instance launch helper
This commit is contained in:
@@ -13,11 +13,10 @@ import (
|
||||
|
||||
var mu sync.Mutex
|
||||
|
||||
// Recover logs a panic and re-raises after writing the crash file.
|
||||
// Recover logs a panic without re-raising (used by optional defer wrappers).
|
||||
func Recover() {
|
||||
if r := recover(); r != nil {
|
||||
_ = write("panic", fmt.Sprint(r), debug.Stack())
|
||||
panic(r)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user