示例#1
0
        protected override bool CanRunParallelTo(ICronJobItem o)
        {
            var other = o as OdetteConnectTcpItem;

            if (other == null || ChannelName == null)
            {
                return(true);
            }

            return(other.ChannelName == ChannelName);
        }         // func CanRunParallelTo
示例#2
0
        }         // 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
示例#3
0
        }         // 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
示例#4
0
        }         // 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
示例#5
0
		protected override bool CanRunParallelTo(ICronJobItem o)
		{
			var other = o as OdetteConnectTcpItem;
			if (other == null || ChannelName == null)
				return true;

			return other.ChannelName == ChannelName;
		} // func CanRunParallelTo
示例#6
0
        }         // func ICronJobExecute.CanRunParallelTo

        protected virtual bool CanRunParallelTo(ICronJobItem o)
        => true;