MCPcopy Create free account
hub / github.com/LumaAI-API/Luma-API / SafeGoroutine

Function SafeGoroutine

common/utils.go:20–29  ·  view source on GitHub ↗
(f func())

Source from the content-addressed store, hash-verified

18)
19
20func SafeGoroutine(f func()) {
21 go func() {
22 defer func() {
23 if r := recover(); r != nil {
24 Logger.Error(fmt.Sprintf("child goroutine panic occured: error: %v, stack: %s", r, string(debug.Stack())))
25 }
26 }()
27 f()
28 }()
29}
30
31func Any2String(inter interface{}) string {
32 if inter == nil {

Callers 1

mainFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected