修复 请求AI超时后不记录日志问题

This commit is contained in:
小肥羊 2025-11-11 18:22:08 +08:00
parent 3f113a9bc5
commit 363bf5325e
1 changed files with 4 additions and 3 deletions

View File

@ -138,8 +138,9 @@ namespace VideoAnalysisCore.AICore.GPT
} }
} }
} }
await redisManager.AddTaskLog(chatReq.taskId, DateTime.Now + "=>AI请求超时 " + chatReq.taskId); throw new Exception(DateTime.Now + "=>AI请求超时 " + chatReq.taskId);
return null; //await redisManager.AddTaskLog(chatReq.taskId, DateTime.Now + "=>AI请求超时 " + chatReq.taskId);
//return null;
} }
/// <summary> /// <summary>
@ -202,7 +203,7 @@ namespace VideoAnalysisCore.AICore.GPT
} }
catch (Exception ex) catch (Exception ex)
{ {
await redisManager.AddTaskLog(chatRep.taskId, $"=>GPT结果解析错误 重试剩余{tryCount} {ex.Message}"); await redisManager.AddTaskLog(chatRep.taskId, $"=>GPT结果解析错误 重试剩余{tryCount} {ex.Message} {ex.StackTrace}");
} }
} }
await redisManager.AddTaskLog(chatRep.taskId, $"=>GPT请求失败次数过多!!!"); await redisManager.AddTaskLog(chatRep.taskId, $"=>GPT请求失败次数过多!!!");