From da9eb4ce809867866f8713ec28c84b8146811902 Mon Sep 17 00:00:00 2001 From: luosheng Date: Sun, 12 Feb 2023 08:33:19 +0800 Subject: [PATCH] Bug Fix --- .../Modbus.Net/Job/JobChainingJobListenerWithDataMap.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modbus.Net/Modbus.Net/Job/JobChainingJobListenerWithDataMap.cs b/Modbus.Net/Modbus.Net/Job/JobChainingJobListenerWithDataMap.cs index 85c8116..559b6f9 100644 --- a/Modbus.Net/Modbus.Net/Job/JobChainingJobListenerWithDataMap.cs +++ b/Modbus.Net/Modbus.Net/Job/JobChainingJobListenerWithDataMap.cs @@ -54,12 +54,12 @@ namespace Modbus.Net.Job var sjJobDetail = await context.Scheduler.GetJobDetail(sj); foreach (var entry in context.JobDetail.JobDataMap) { - if (!OverWrite && !sjJobDetail.JobDataMap.ContainsKey(entry.Key)) + if (!OverWrite && !sjJobDetail.JobDataMap.ContainsKey(entry.Key) || OverWrite) { - sjJobDetail.JobDataMap.Put(entry.Key, entry.Value); - await context.Scheduler.AddJob(sjJobDetail, true, false); + sjJobDetail.JobDataMap.Put(entry.Key, entry.Value); } } + await context.Scheduler.AddJob(sjJobDetail, true, false); await context.Scheduler.TriggerJob(sj, cancellationToken).ConfigureAwait(false); } catch (SchedulerException se)