From 37121866e38f72eeefff23dc87aebfc7e48a1c04 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 4 Sep 2019 23:09:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Task=20=E6=94=AF=E6=8C=81=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=8C=81=E4=B9=85=E5=8C=96=E5=88=B0=E7=89=A9=E7=90=86?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #Comment TaskStorage 目录下 --- src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj | 2 +- .../Bootstrap.Admin/Controllers/Api/TasksLogController.cs | 2 +- src/admin/Bootstrap.Admin/appsettings.json | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj b/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj index c10a650a..2b576960 100644 --- a/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj +++ b/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/admin/Bootstrap.Admin/Controllers/Api/TasksLogController.cs b/src/admin/Bootstrap.Admin/Controllers/Api/TasksLogController.cs index 7e8301b0..85ce98a3 100644 --- a/src/admin/Bootstrap.Admin/Controllers/Api/TasksLogController.cs +++ b/src/admin/Bootstrap.Admin/Controllers/Api/TasksLogController.cs @@ -22,7 +22,7 @@ namespace Bootstrap.Admin.Controllers.Api [HttpGet] public async Task Get([FromQuery]string name, [FromServices]IHubContext hub) { - var sche = TaskServicesManager.GetOrAdd(name); + var sche = TaskServicesManager.Get(name); sche.Triggers.First().PulseCallback = t => SendTaskLog(sche, name, hub).ConfigureAwait(false); await SendTaskLog(sche, name, hub).ConfigureAwait(false); return Ok(true); diff --git a/src/admin/Bootstrap.Admin/appsettings.json b/src/admin/Bootstrap.Admin/appsettings.json index cd10f7af..6743df1e 100644 --- a/src/admin/Bootstrap.Admin/appsettings.json +++ b/src/admin/Bootstrap.Admin/appsettings.json @@ -54,6 +54,13 @@ "Sentry": { "Dsn": "https://70bdfff562e84fa7b9a43d65924ab9ad@sentry.io/1469396" }, + "TaskServicesOptions": { + "ShutdownTimeout": "00:00:05", + "FileStorageOptions": { + "Enabled": true, + "Folder": "TaskStorage" + } + }, "LongbowCache": { "Enabled": true, "CorsItems": [