MCPcopy
hub / github.com/lonng/nano / safecall

Function safecall

scheduler/timer.go:93–101  ·  view source on GitHub ↗

execute job function with protection

(id int64, fn TimerFunc)

Source from the content-addressed store, hash-verified

91
92// execute job function with protection
93func safecall(id int64, fn TimerFunc) {
94 defer func() {
95 if err := recover(); err != nil {
96 log.Println(fmt.Sprintf("Handle timer panic: %+v\n%s", err, debug.Stack()))
97 }
98 }()
99
100 fn()
101}
102
103func cron() {
104 if len(timerManager.createdTimer) > 0 {

Callers 1

cronFunction · 0.85

Calls 1

PrintlnMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…