feat: Task 支持任务持久化到物理文件

#Comment
TaskStorage 目录下
This commit is contained in:
Argo Zhang 2019-09-04 23:09:01 +08:00
parent bf51dca5d0
commit 37121866e3
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
3 changed files with 9 additions and 2 deletions

View File

@ -12,7 +12,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Bootstrap.Security.Mvc" Version="2.2.15-preview-1" /> <PackageReference Include="Bootstrap.Security.Mvc" Version="2.2.15-preview-1" />
<PackageReference Include="Longbow.Configuration" Version="2.2.7" /> <PackageReference Include="Longbow.Configuration" Version="2.2.7" />
<PackageReference Include="Longbow.Tasks" Version="1.9.0" /> <PackageReference Include="Longbow.Tasks" Version="1.10.0-preview-2" />
<PackageReference Include="Microsoft.AspNetCore.App" /> <PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="3.1.6" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="3.1.6" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" PrivateAssets="All" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" PrivateAssets="All" />

View File

@ -22,7 +22,7 @@ namespace Bootstrap.Admin.Controllers.Api
[HttpGet] [HttpGet]
public async Task<ActionResult> Get([FromQuery]string name, [FromServices]IHubContext<TaskLogHub> hub) public async Task<ActionResult> Get([FromQuery]string name, [FromServices]IHubContext<TaskLogHub> hub)
{ {
var sche = TaskServicesManager.GetOrAdd(name); var sche = TaskServicesManager.Get(name);
sche.Triggers.First().PulseCallback = t => SendTaskLog(sche, name, hub).ConfigureAwait(false); sche.Triggers.First().PulseCallback = t => SendTaskLog(sche, name, hub).ConfigureAwait(false);
await SendTaskLog(sche, name, hub).ConfigureAwait(false); await SendTaskLog(sche, name, hub).ConfigureAwait(false);
return Ok(true); return Ok(true);

View File

@ -54,6 +54,13 @@
"Sentry": { "Sentry": {
"Dsn": "https://70bdfff562e84fa7b9a43d65924ab9ad@sentry.io/1469396" "Dsn": "https://70bdfff562e84fa7b9a43d65924ab9ad@sentry.io/1469396"
}, },
"TaskServicesOptions": {
"ShutdownTimeout": "00:00:05",
"FileStorageOptions": {
"Enabled": true,
"Folder": "TaskStorage"
}
},
"LongbowCache": { "LongbowCache": {
"Enabled": true, "Enabled": true,
"CorsItems": [ "CorsItems": [