diff --git a/build/releasenotes.props b/build/releasenotes.props index 2a76566..1bf440e 100644 --- a/build/releasenotes.props +++ b/build/releasenotes.props @@ -1,7 +1,7 @@ - 1. 修复回调一次过多的问题 + 1. 修复执行策略ExecutorBlockStrategy.DISCARD_LATER的逻辑错误 1. 实现基本的Hessian协议 diff --git a/build/version.props b/build/version.props index f536820..f97a19f 100644 --- a/build/version.props +++ b/build/version.props @@ -1,6 +1,6 @@ - 1.0.8 + 1.0.9 1.0.1 diff --git a/scripts/nuget.sh b/scripts/nuget.sh index 90c1874..af434aa 100644 --- a/scripts/nuget.sh +++ b/scripts/nuget.sh @@ -13,6 +13,6 @@ mkdir -p $artifactsFolder dotnet build ./src/DotXxlJob.Core/DotXxlJob.Core.csproj -c Release -dotnet pack ./src/DotXxlJob.Core/DotXxlJob.Core.csproj -c Release -o ../../$artifactsFolder +dotnet pack ./src/DotXxlJob.Core/DotXxlJob.Core.csproj -c Release -o $artifactsFolder -dotnet nuget push ./$artifactsFolder/DotXxlJob.Core.*.nupkg -k $NUGET_KEY -s https://www.nuget.org +dotnet nuget push $artifactsFolder/DotXxlJob.Core.*.nupkg -k $NUGET_KEY -s https://www.nuget.org diff --git a/src/DotXxlJob.Core/JobDispatcher.cs b/src/DotXxlJob.Core/JobDispatcher.cs index 00e19bf..a099ccd 100644 --- a/src/DotXxlJob.Core/JobDispatcher.cs +++ b/src/DotXxlJob.Core/JobDispatcher.cs @@ -82,7 +82,11 @@ namespace DotXxlJob.Core //丢弃后续的 if (Constants.ExecutorBlockStrategy.DISCARD_LATER == triggerParam.ExecutorBlockStrategy) { - return ReturnT.Failed($"block strategy effect:{triggerParam.ExecutorBlockStrategy}"); + if (taskQueue.IsRunning()) + { + return ReturnT.Failed($"block strategy effect:{triggerParam.ExecutorBlockStrategy}"); + } + } //覆盖较早的 if (Constants.ExecutorBlockStrategy.COVER_EARLY == triggerParam.ExecutorBlockStrategy) diff --git a/src/DotXxlJob.Core/Queue/JobTaskQueue.cs b/src/DotXxlJob.Core/Queue/JobTaskQueue.cs index ead1c67..1f51b78 100644 --- a/src/DotXxlJob.Core/Queue/JobTaskQueue.cs +++ b/src/DotXxlJob.Core/Queue/JobTaskQueue.cs @@ -27,15 +27,18 @@ namespace DotXxlJob.Core public event EventHandler CallBack; - - - /// - /// 覆盖之前的队列 - /// - /// - /// - public ReturnT Replace(TriggerParam triggerParam) + + public bool IsRunning() + { + return _cancellationTokenSource != null; + } + /// + /// 覆盖之前的队列 + /// + /// + /// + public ReturnT Replace(TriggerParam triggerParam) { Stop(); while (!TASK_QUEUE.IsEmpty) @@ -151,5 +154,7 @@ namespace DotXxlJob.Core } + + } } \ No newline at end of file