protected override bool CanRunParallelTo(ICronJobItem o) { var other = o as OdetteConnectTcpItem; if (other == null || ChannelName == null) { return(true); } return(other.ChannelName == ChannelName); } // func CanRunParallelTo
} // func UpdateNextRuntime void IDECronEngine.UpdateNextRuntime(ICronJobItem job, DateTime?next) { if (job == null) { throw new ArgumentNullException(nameof(job)); } var n = next ?? (job.Bound.IsEmpty ? DateTime.Now.AddHours(1) : job.Bound.GetNext(DateTime.Now)); if (n < DateTime.Now) { throw new ArgumentOutOfRangeException(nameof(next), n, "Timestamp must not be in the past."); } UpdateNextRuntime(job, n, true, true); } // proc UpdateNextRuntime
} // proc SaveNextRuntime private void ClearNextRuntime(ICronJobItem job) { if (cronItemCache == null || job == null) { return; } lock (cronItemCacheLock) { var index = Array.FindIndex(cronItemCache, c => c.Job == job); if (index >= 0) { cronItemCache[index].NextRun = null; } } } // proc ClearNextRuntime
} // proc ClearNextRuntime private void UpdateNextRuntime(ICronJobItem job, DateTime next, bool save, bool force) { if (cronItemCache == null) { return; } lock (cronItemCacheLock) { var index = Array.FindIndex(cronItemCache, c => c.Job == job); if (index >= 0 && (force || !cronItemCache[index].NextRun.HasValue)) { cronItemCache[index].NextRun = next; job.NotifyNextRun(next); if (save) { SaveNextRuntime(); } } } } // func UpdateNextRuntime
protected override bool CanRunParallelTo(ICronJobItem o) { var other = o as OdetteConnectTcpItem; if (other == null || ChannelName == null) return true; return other.ChannelName == ChannelName; } // func CanRunParallelTo
} // func ICronJobExecute.CanRunParallelTo protected virtual bool CanRunParallelTo(ICronJobItem o) => true;