修复 部分单例应用写入数据库时未能COPY NEW的问题导致的写入失败
This commit is contained in:
parent
53951aa870
commit
dac6eee091
|
|
@ -173,7 +173,7 @@ namespace VideoAnalysisCore.AICore.GPT.DeepSeek
|
|||
|| s.Depth == 2))
|
||||
.Select(s => s.Name).ToArrayAsync();
|
||||
var captionsArr = JsonSerializer.Deserialize<SenseVoiceRes[]>(taskInfo.Captions);
|
||||
|
||||
|
||||
var fileNameResFormat = "{授课章节: string|null}";
|
||||
var rCaptionArr = string.Join(',', captionsArr
|
||||
.Where((s, i) => i % 3 == 0)
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ namespace VideoAnalysisCore.Common
|
|||
{
|
||||
var taskId = long.Parse(task);
|
||||
//获取资源文件 地址
|
||||
var taskInfo = await videoTaskDB.AsQueryable()
|
||||
var taskInfo = await videoTaskDB.CopyNew().AsQueryable()
|
||||
.Where(s => s.Id == taskId).FirstAsync();
|
||||
if (taskInfo is null )
|
||||
throw new Exception($"任务为null/是教研视频/没有视频课程名称");
|
||||
|
|
@ -176,7 +176,7 @@ namespace VideoAnalysisCore.Common
|
|||
var outputPath = Path.Combine(localPath, taskVideoName);
|
||||
if (!Directory.Exists(localPath)) Directory.CreateDirectory(localPath);
|
||||
|
||||
await videoTaskDB
|
||||
await videoTaskDB.CopyNew()
|
||||
.AsUpdateable()
|
||||
.SetColumns(it => it.LocalMediaPath == outputPath)
|
||||
.Where(it => it.Id == long.Parse(task))
|
||||
|
|
@ -190,7 +190,7 @@ namespace VideoAnalysisCore.Common
|
|||
.Select(s => s.VideoUrl)
|
||||
.FirstAsync();
|
||||
if (!string.IsNullOrEmpty(taskInfo.PPTVideoUrl))
|
||||
await videoTaskDB.AsUpdateable(taskInfo)
|
||||
await videoTaskDB.CopyNew().AsUpdateable(taskInfo)
|
||||
.UpdateColumns(it => new { it.PPTVideoUrl })
|
||||
.ExecuteCommandAsync();
|
||||
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ namespace VideoAnalysisCore.Common
|
|||
try
|
||||
{
|
||||
var insertData = Redis.LRange<TaskLog>(RedisExpandKey.TaskLog, 0, count -1);
|
||||
taskLogDB.AsInsertable(insertData).ExecuteCommand();
|
||||
taskLogDB.CopyNew().AsInsertable(insertData).ExecuteCommand();
|
||||
//同步删除redis
|
||||
Redis.LTrim(RedisExpandKey.TaskLog, count, 1000);
|
||||
}
|
||||
|
|
@ -386,6 +386,7 @@ namespace VideoAnalysisCore.Common
|
|||
//删除任务执行状态
|
||||
await Redis.LRemAsync(RedisExpandKey.IDTask, 1, task);
|
||||
var taskData = await videoTaskDB
|
||||
.CopyNew()
|
||||
.GetFirstAsync(s => s.Id == tId);
|
||||
if (taskData.Captions == "[]")
|
||||
taskData.Captions = (await Redis.HMGetAsync(RedisExpandKey.Task(task), "Captions")).First();
|
||||
|
|
@ -399,7 +400,7 @@ namespace VideoAnalysisCore.Common
|
|||
taskData.ErrorMessage = string.Empty;
|
||||
taskData.LastEnum = RedisChannelEnum.结束任务;
|
||||
taskData.EndTime = DateTime.Now;
|
||||
await videoTaskDB.AsUpdateable(taskData)
|
||||
await videoTaskDB.CopyNew().AsUpdateable(taskData)
|
||||
.UpdateColumns(it => new
|
||||
{
|
||||
//it.ChatAnalysis,
|
||||
|
|
|
|||
Loading…
Reference in New Issue