@@ -66,6 +66,10 @@ type Handler struct {
6666 reqCountMu sync.RWMutex
6767 reqCountCache map [int64 ]* database.AccountRequestCount
6868 reqCountExpiresAt time.Time
69+
70+ resetRadarHookMu sync.Mutex
71+ resetRadarHookState resetRadarHookState
72+ resetRadarHookRunner func (context.Context , string ) resetRadarHookResult
6973}
7074
7175type chartCacheEntry struct {
@@ -184,6 +188,7 @@ func NewHandler(store *auth.Store, db *database.DB, tc cache.TokenCache, rl *pro
184188 }
185189 handler .refreshAccount = handler .refreshSingleAccount
186190 handler .syncAccountPlanOnReset = handler .syncSingleAccountPlanOnReset
191+ handler .resetRadarHookRunner = handler .runResetRadarSignalHook
187192 if db != nil {
188193 if err := db .MarkInterruptedImageJobs (context .Background ()); err != nil {
189194 log .Printf ("标记中断生图任务失败: %v" , err )
@@ -264,6 +269,7 @@ func (h *Handler) RegisterRoutes(r *gin.Engine) {
264269 api .GET ("/ops/errors" , h .GetOpsErrorLogs )
265270 api .GET ("/ops/errors/export" , h .ExportOpsErrorLogs )
266271 api .GET ("/ops/errors/summary" , h .GetOpsErrorSummary )
272+ api .GET ("/reset-radar" , h .GetResetRadar )
267273 api .GET ("/settings" , h .GetSettings )
268274 api .PUT ("/settings" , h .UpdateSettings )
269275 api .POST ("/settings/background-upload" , h .UploadBackgroundAsset )
0 commit comments