Initial commit

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
fish03
2026-09-23 14:43:16 +07:00
co-authored by Claude Opus 5.5
commit bef9f8b4ed
663 changed files with 81305 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
package godef
import (
"runtime"
"videoweb/pub/common/log"
"videoweb/pub/common/tgbot"
)
func Go(f func()) {
//atomic.AddInt64(&routineCount, 1)
go func() {
defer func() {
//atomic.AddInt64(&routineCount, -1)
if r := recover(); r != nil {
buf := make([]byte, 2048)
length := runtime.Stack(buf, false)
info := string(buf[:length])
log.Error("cat a unkown excetion", log.Any("excetion :", info), log.Any("e", r))
//发送tg消息
msg := "goroutine crash,the stack:\n" + info
tgbot.SendToProgram("程序异常", msg)
}
}()
f()
}()
}