public void Execute(IJobExecutionContext context)
        {
            //JobDataMap dataMap = context.JobDetail.JobDataMap;
            JobDataMap dataMap = context.MergedJobDataMap;

            var daysToKeep = dataMap.GetIntValue("DaysToKeep");

            Tasks.CleanupPublishQueue cleanPQTask = new Tasks.CleanupPublishQueue();
            cleanPQTask.DaysToKeep = daysToKeep;
            cleanPQTask.Run();

            Log.Info(String.Format("Job \"{0}\" triggered at {1} UTC with DaysToKeep configured as {2} days.", context.JobDetail.Key, context.Trigger.GetPreviousFireTimeUtc(), daysToKeep), this);
        }
Beispiel #2
0
        public void Execute(IJobExecutionContext context)
        {
            //JobDataMap dataMap = context.JobDetail.JobDataMap;
            JobDataMap dataMap = context.MergedJobDataMap;

            var daysToKeep = dataMap.GetIntValue("DaysToKeep");

            Tasks.CleanupPublishQueue cleanPQTask = new Tasks.CleanupPublishQueue();
            cleanPQTask.DaysToKeep = daysToKeep;
            cleanPQTask.Run();


            Log.Info(String.Format("Job \"{0}\" triggered at {1} UTC with DaysToKeep configured as {2} days.", context.JobDetail.Key, context.Trigger.GetPreviousFireTimeUtc(), daysToKeep), this);
        }
        public void Execute(IJobExecutionContext context)
        {
            try
            {
                JobDataMap dataMap = context.MergedJobDataMap;

                var daysToKeep = dataMap.GetIntValue("DaysToKeep");

                Tasks.CleanupPublishQueue cleanPQTask = new Tasks.CleanupPublishQueue();
                cleanPQTask.DaysToKeep = daysToKeep;
                cleanPQTask.Run();

                Log.Info(String.Format("Job \"{0}\" triggered at {1} UTC with DaysToKeep configured as {2} days.", context.JobDetail.Key, context.Trigger.GetPreviousFireTimeUtc(), daysToKeep), this);
            }
            catch(Exception ex)
            {
                Log.Error("Sitecore.QuartzScheuler: " + ex.Message + Environment.NewLine + ex.StackTrace, this);
                throw ex;
            }
        }
Beispiel #4
0
        public void Execute(IJobExecutionContext context)
        {
            try
            {
                JobDataMap dataMap = context.MergedJobDataMap;

                var daysToKeep = dataMap.GetIntValue("DaysToKeep");

                Tasks.CleanupPublishQueue cleanPQTask = new Tasks.CleanupPublishQueue();
                cleanPQTask.DaysToKeep = daysToKeep;
                cleanPQTask.Run();


                Log.Info(String.Format("Job \"{0}\" triggered at {1} UTC with DaysToKeep configured as {2} days.", context.JobDetail.Key, context.Trigger.GetPreviousFireTimeUtc(), daysToKeep), this);
            }
            catch (Exception ex)
            {
                Log.Error("Sitecore.QuartzScheuler: " + ex.Message + Environment.NewLine + ex.StackTrace, this);
                throw ex;
            }
        }