diff --git a/Falcon.SugarApi/Falcon.SugarApi.csproj b/Falcon.SugarApi/Falcon.SugarApi.csproj index 199e672..202a601 100644 --- a/Falcon.SugarApi/Falcon.SugarApi.csproj +++ b/Falcon.SugarApi/Falcon.SugarApi.csproj @@ -8,7 +8,7 @@ bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml true true - 2.13.0 + 2.14.0 diff --git a/Falcon.SugarApi/TimedBackgroundTask/TimedTask.cs b/Falcon.SugarApi/TimedBackgroundTask/TimedTask.cs index fadd64b..38708bb 100644 --- a/Falcon.SugarApi/TimedBackgroundTask/TimedTask.cs +++ b/Falcon.SugarApi/TimedBackgroundTask/TimedTask.cs @@ -9,7 +9,7 @@ namespace Falcon.SugarApi.TimedBackgroundTask /// /// 由定时器驱动的后台任务 /// - public class TimedTask:BackgroundService, IDisposable + public abstract class TimedTask:BackgroundService, IDisposable { /// /// 日志记录器 @@ -25,7 +25,7 @@ namespace Falcon.SugarApi.TimedBackgroundTask /// /// 退出信号 /// 如果继续执行返回True,否则False - public virtual async Task Run(CancellationToken cancellationToken) => await Task.FromResult(true); + public abstract Task Run(CancellationToken cancellationToken); /// /// Timer心跳 @@ -127,8 +127,12 @@ namespace Falcon.SugarApi.TimedBackgroundTask this.NextTickTime = s.GetNextOccurrence(DateTime.Now); } + /// + /// 释放对象 + /// public override void Dispose() { this._timer?.Dispose(); + GC.SuppressFinalize(this); base.Dispose(); } }