Ejemplo n.º 1
0
 private void btnRunJob_Click(object sender, EventArgs e)
 {
     ScheduleJobSpawner.SpawAndRun(job);
     timer_Tick(timer, new EventArgs());
     //Enabled = false;
     //try {
     //    job.Execute();
     //    Form1.Instance.RefreshJobs();
     //} finally {
     //    Enabled = true;
     //}
 }
Ejemplo n.º 2
0
        public void Execute(JobExecutionContext context)
        {
            int jobID;

            if (!int.TryParse(context.JobDetail.Name, out jobID))
            {
                Logger.Log("Error getting ID for job to execute", LogStatuses.Error);
                return;
            }
            BackupScheduleWrapper schedule = Configuration.GetSchedule(jobID);

            if (schedule == null)
            {
                Logger.Log("Error getting Schedule for {0}".FillBlanks(jobID), LogStatuses.Error);
                return;
            }
            Logger.Log("Running schedule {0}".FillBlanks(schedule.Name), LogStatuses.Execute);
            ScheduleJobSpawner.SpawAndRun(schedule);
        }