feat: 增加系统内置任务保护

This commit is contained in:
Argo Zhang 2020-02-19 15:32:35 +08:00
parent 6187cf8fc9
commit 921180b5c4
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 1 additions and 0 deletions

View File

@ -56,6 +56,7 @@ namespace Bootstrap.Admin.Controllers.Api
{
// 判断 Cron 表达式
if (string.IsNullOrEmpty(widget.CronExpression)) return false;
if (_tasks.Any(t => t.Equals(widget.Name, StringComparison.OrdinalIgnoreCase))) return false;
// 加载任务执行体
// 此处可以扩展为任意 DLL 中的任意继承 ITask 接口的实体类