parent
6015245d78
commit
94cde3af70
|
|
@ -120,7 +120,7 @@
|
|||
"LastEnvName": "10楼刀片机",
|
||||
"RemoveDaysFromPublished": "10",
|
||||
"WorkDir": "/home/heyang/",
|
||||
"Volume": "/home/hy/VideoAnalysis/AICore:/app/AICore/_Static;/home/hy/VideoAnalysis/TaskCachedFile:/app/TaskCachedFile",
|
||||
"Volume": "/home/hy/VideoAnalysis/AICore:/app/AICore/_Static;/mnt/2tb/VideoAnalysis/TaskCachedFile:/app/TaskCachedFile",
|
||||
"Other": "-e va_args=\"\"",
|
||||
"EnvPairList": [
|
||||
{
|
||||
|
|
@ -129,7 +129,7 @@
|
|||
"LinuxEnvParam": null,
|
||||
"DockerPort": "9040",
|
||||
"DockerEnvName": "",
|
||||
"DockerVolume": "/home/hy/VideoAnalysis/AICore:/app/AICore/_Static;/home/hy/VideoAnalysis/TaskCachedFile:/app/TaskCachedFile",
|
||||
"DockerVolume": "/home/hy/VideoAnalysis/AICore:/app/AICore/_Static;/mnt/2tb/VideoAnalysis/TaskCachedFile:/app/TaskCachedFile",
|
||||
"DockerOther": "-e va_args=\"\""
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ namespace VideoAnalysisCore.AICore.SherpaOnnx
|
|||
.ExecuteCommandAsync();
|
||||
await RedisExpand.Redis.HMSetAsync(RedisExpandKey.Task(task), "Captions", res);
|
||||
//分析完成视频字幕后继续接收任务
|
||||
RedisExpand.NewTaskAsync();
|
||||
RedisExpand.NewTask();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ namespace VideoAnalysisCore.Common.Expand
|
|||
DbType = s.SqlType,
|
||||
IsAutoCloseConnection = true
|
||||
}));
|
||||
services.AddTransient(typeof(Repository<>));
|
||||
services.AddScoped(typeof(Repository<>));
|
||||
|
||||
//注入SqlSugar 主库
|
||||
services.AddSqlSugar(dbList);
|
||||
|
|
|
|||
|
|
@ -297,20 +297,23 @@ namespace VideoAnalysisCore.Common
|
|||
/// <summary>
|
||||
/// 开始接收新任务
|
||||
/// </summary>
|
||||
public static void RestartTaskAsync()
|
||||
public static void RestartTask()
|
||||
{
|
||||
StopTask = false;
|
||||
NewTaskAsync();
|
||||
NewTask();
|
||||
}
|
||||
/// <summary>
|
||||
/// 重新执行新任务
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async void NewTaskAsync()
|
||||
public static void NewTask()
|
||||
{
|
||||
// 取消 消费机的任务订阅
|
||||
if (StopTask)
|
||||
{
|
||||
Console.WriteLine(DateTime.Now.ToString("HH:mm:ss") + "-------------> 接收任务已经暂停 ");
|
||||
return;
|
||||
}
|
||||
ReceivingTaskAsync();
|
||||
}
|
||||
|
||||
|
|
@ -374,7 +377,7 @@ namespace VideoAnalysisCore.Common
|
|||
Console.WriteLine(ex.StackTrace);
|
||||
Console.WriteLine("==============================================");
|
||||
//清除失败任务 重新接收任务
|
||||
NewTaskAsync();
|
||||
NewTask();
|
||||
}
|
||||
return await SetTaskError(taskID, error);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,16 +24,16 @@ namespace VideoAnalysisCore.Common
|
|||
if (CID.ContainsKey(t))
|
||||
{
|
||||
base.Context = CID[t]!=null
|
||||
? DbScoped.Sugar.GetConnectionScope(CID[t])
|
||||
: DbScoped.Sugar;
|
||||
? DbScoped.SugarScope.GetConnectionScope(CID[t])
|
||||
: DbScoped.SugarScope;
|
||||
return;
|
||||
}
|
||||
var c = t.GetCustomAttribute<TenantAttribute>();
|
||||
if (!CID.ContainsKey(t))
|
||||
CID.Add(t, c?.configId);
|
||||
base.Context = c != null
|
||||
? DbScoped.Sugar.GetConnectionScope(c.configId)
|
||||
: DbScoped.Sugar;
|
||||
? DbScoped.SugarScope.GetConnectionScope(c.configId)
|
||||
: DbScoped.SugarScope;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,13 +76,16 @@ namespace VideoAnalysisCore.Controllers
|
|||
/// <summary>
|
||||
/// ³õʼ»¯Ö÷¿â±í
|
||||
/// </summary>
|
||||
/// <param name="url">文件流</param>
|
||||
/// <param name="task">是否执行任务</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet(Name = "tets1")]
|
||||
public IActionResult tets1(string task)
|
||||
[HttpGet(Name = "StartTask")]
|
||||
public IActionResult StartTask(bool task)
|
||||
{
|
||||
var courseArr = courseInfoDB.AsQueryable().ToArray();
|
||||
return Ok(courseArr);
|
||||
if(task)
|
||||
RedisExpand.RestartTask();
|
||||
else
|
||||
RedisExpand.StopTaskAsync();
|
||||
return Ok();
|
||||
}
|
||||
/// <summary>
|
||||
/// ÓïÒôʶ±ð
|
||||
|
|
|
|||
Loading…
Reference in New Issue