fix(team_process): Clean up stuck processing owners on startup and batch completion
- Add CleanupStuckProcessingOwners database method to reset owners stuck in processing status back to valid state - Call cleanup routine on application startup to recover from previous abnormal exits - Call cleanup routine after batch processing completes to ensure no orphaned processing states remain - Add markOwnerResult calls in processSingleTeam when team invitations are full to properly track owner status - Prevents owners from being permanently stuck in processing state due to unexpected shutdowns or errors
This commit is contained in:
@@ -85,6 +85,11 @@ func main() {
|
||||
fmt.Printf("%s[清理]%s 已清理 %d 个遗留的运行中批次记录\n", colorYellow, colorReset, affected)
|
||||
}
|
||||
|
||||
// 启动时清理遗留的 processing 状态母号(上次异常退出可能残留)
|
||||
if affected, err := database.Instance.CleanupStuckProcessingOwners(); err == nil && affected > 0 {
|
||||
fmt.Printf("%s[清理]%s 已重置 %d 个残留的处理中母号为有效状态\n", colorYellow, colorReset, affected)
|
||||
}
|
||||
|
||||
// 启动自动补号检查器(需在前端开启开关才会实际补号)
|
||||
api.StartAutoAddService()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user