修复:weblive 协程 panic 防护、Mongo 空指针防护、直播状态轮询退避

Made-with: Cursor
This commit is contained in:
whm
2026-03-25 16:45:22 +08:00
parent 70e6782713
commit 7e24a965bc
6 changed files with 70 additions and 12 deletions

View File

@@ -47,6 +47,11 @@ func GetWebHomepage(c *gin.Context) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
if config.MongoClient == nil {
c.JSON(http.StatusOK, defaultHomepageData())
return
}
siteID := getOfficialSiteID(ctx)
if siteID == "" {
c.JSON(http.StatusOK, defaultHomepageData())