fix(startup): make watchdog task keep agent alive
- Use Task Scheduler XML instead of /TR - Run -ensure agent in-process, not child - Add console close and panic protection - Guard nil event channels after stop - Add non-Windows stubs for startup/mutex
This commit is contained in:
@@ -98,8 +98,12 @@ func Stop() {
|
||||
|
||||
func emit(event Event) {
|
||||
event.Time = time.Now()
|
||||
ch := events
|
||||
if ch == nil {
|
||||
return
|
||||
}
|
||||
select {
|
||||
case events <- event:
|
||||
case ch <- event:
|
||||
default:
|
||||
// ponytail: drop when full
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user