Exemple #1
0
        private void ConfigReaderOnJobRead(object sender, ConfigReader.JobArgs jobArgs)
        {
            var job = jobArgs.Service ? (Job)ServiceJob.Parse(jobArgs, Settings) : CronJob.Parse(jobArgs, Settings);

            if (job == null)
            {
                return;
            }

            if (string.IsNullOrEmpty(job.Settings.Home))
            {
                job.Settings.Home = Path.FullName;
            }

            job.VerifyExecutableExists();
            Jobs.Add(job);
        }
Exemple #2
0
        public void TestGetCode()
        {
            var args = new ConfigReader.JobArgs
              {
            Command = "process.exe",
            Day = "*",
            Hour = "*",
            Minute = "0,15,30,45",
            Month = "*/2",
            Weekday = "*",
              };

              var job = CronJob.Parse(args, new Settings
              {
            Home = "c:\\windows",
            Timeout = 86400
              });

              Assert.AreEqual("CronJob,process.exe,c:\\windows,False,,,,,False,,,False,,86400,,127,1365,2147483647,16777215,35185445863425", job.GetJobCode());
        }