chore: baseline snapshot before moderation-strictness feature

Repo .git was damaged (refs/ missing, index truncated, object store near-empty).
Repaired via git init (rebuilt refs), stale index preserved as .git/index.corrupt-20260910.bak,
then full worktree committed as a rollback baseline.
This commit is contained in:
tamakyi
2026-09-10 10:56:27 +08:00
commit e3e59e7c69
296 changed files with 67458 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
package shared
import (
"github.com/sirupsen/logrus"
)
// SafeGo 在独立 goroutine 中执行 fn 并捕获 panic,防止任一 goroutine
// panic 未恢复导致整个进程崩溃(Go 默认行为:未恢复的 panic 终止进程)。
//
// 用法:shared.SafeGo(func() { ... })
func SafeGo(fn func()) {
go func() {
defer func() {
if r := recover(); r != nil {
logrus.WithField("panic", r).Error("goroutine panic recovered")
}
}()
fn()
}()
}