From 02b124217f6fe7f350e304bb6c169b10b8d7773e Mon Sep 17 00:00:00 2001 From: vinhch Date: Mon, 24 Jul 2017 23:26:22 +0700 Subject: [PATCH] add LastRunAt and IsSelfExecute --- SimpleScheduler/IJobInfo.cs | 5 ++++- SimpleScheduler/JobInfo.cs | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/SimpleScheduler/IJobInfo.cs b/SimpleScheduler/IJobInfo.cs index 1ffe349..ca4f2f8 100644 --- a/SimpleScheduler/IJobInfo.cs +++ b/SimpleScheduler/IJobInfo.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System; +using System.Threading.Tasks; namespace SimpleScheduler { @@ -11,6 +12,8 @@ public interface IJobInfo bool StopOnError { get; } int RepetitionIntervalTime { get; } string Schedule { get; } + DateTimeOffset LastRunAt { get; } + bool IsSelfExecute { get; } Task InitializeSchedule(); } } diff --git a/SimpleScheduler/JobInfo.cs b/SimpleScheduler/JobInfo.cs index c9b57c7..164848a 100644 --- a/SimpleScheduler/JobInfo.cs +++ b/SimpleScheduler/JobInfo.cs @@ -70,6 +70,10 @@ private TimeSchedule GetTimeSchedule() }; } + public DateTimeOffset LastRunAt { get; private set; } + + public bool IsSelfExecute { get; } = true; //TODO: create a pool for not self execute jobs (job without a loop to running itself) + private string JobType { get; } private Type _objectType;