Example #1
0
        public void ScheduleIEProcess(SchedulerReference schedulerReference)
        {
            var imageExchange = schedulerReference.GetSchedulerDetailByProcessName(SchedulerProcess.ImageExchange);

            RecurringJob.AddOrUpdate<IImageExchange>(imageExchange.processName,
               x => x.ProcessTask(),
               TaskHelper.UpdateRecurringTaskSchedule(imageExchange.recurringInterval),
               TimeZoneInfo.Local);

            Log.Information("AddOrUpdate {serviceName} RecurringJob.", imageExchange.processName);
        }
Example #2
0
        public void ScheduleInwardForValueProcess(SchedulerReference schedulerReference)
        {
            var inwardsFV = schedulerReference.GetSchedulerDetailByProcessName(SchedulerProcess.InwardForValue);

            RecurringJob.AddOrUpdate<IInwardsFVService>(inwardsFV.processName,
               x => x.ProcessTask(),
               TaskHelper.UpdateRecurringTaskSchedule(inwardsFV.recurringInterval),
               TimeZoneInfo.Local);

            Log.Information("AddOrUpdate {serviceName} RecurringJob.", inwardsFV.processName);
        }
Example #3
0
        public void ScheduleVifProcess(SchedulerReference schedulerReference)
        {
            var vif = schedulerReference.GetSchedulerDetailByProcessName(SchedulerProcess.ValueInformationFile);

            RecurringJob.AddOrUpdate<IVif>(vif.processName,
               x => x.ProcessTask(),
               TaskHelper.UpdateRecurringTaskSchedule(vif.recurringInterval),
               TimeZoneInfo.Local);

            Log.Information("AddOrUpdate {serviceName} RecurringJob.", vif.processName);
        }
Example #4
0
        public void ScheduleInitialEndOfDayProcess(SchedulerReference schedulerReference, BusinessCalendar businessCalendar)
        {
            var initialEodConfig = schedulerReference.GetSchedulerDetailByProcessName(SchedulerProcess.InitialEndOfDay);

            var initialEodStartTime = TaskHelper.GetDateTimeObject(initialEodConfig.startTime);
            if (businessCalendar.isEndOfWeek == true)
            {
                var initEndOfWeekDelayValue = initialEodConfig.endOfWeekDelay;
                var changedInitialEodStartTime = (DateTime?)initialEodStartTime.Value.AddMinutes(initialEodConfig.endOfWeekDelay);

                Log.Information("EODI: Last Processing day of the week. Start Time for {ServiceName} has been pushed for another {delayValue} minute(s). Normal Start Time is {normalStartTime}, EODI Start time {lastProcessingDayStartTime}",
                    initialEodConfig.processName, initialEodConfig.endOfWeekDelay.ToString(), initialEodStartTime.ToString(), changedInitialEodStartTime.ToString());

                initialEodStartTime = changedInitialEodStartTime;
            }

            BackgroundJob.Schedule<IEndOfDayInit>(x => x.ProcessTask(), initialEodStartTime.Value);

            Log.Information("Schedule {serviceName} BackgroundJob.", initialEodConfig.processName);
        }
Example #5
0
        public void ScheduleAusPostProcess(SchedulerReference schedulerReference)
        {
            var ausPostEclConfig = schedulerReference.GetSchedulerDetailByProcessName(SchedulerProcess.AusPostECL);

            var ausPostEclDate = TaskHelper.GetDateTimeObject(ausPostEclConfig.startTime);

            BackgroundJob.Schedule<IAusPostECL>(x => x.ProcessTask(ausPostEclConfig.workType), ausPostEclDate.Value);

            Log.Information("Schedule {serviceName} BackgroundJob.", ausPostEclConfig.processName);
        }
Example #6
0
        public void ScheduleAgencyBankProcess(SchedulerReference schedulerReference)
        {
            var agencyBankConfig = schedulerReference.GetSchedulerDetailByProcessName(SchedulerProcess.AgencyBank);

            var agencyBankDate = TaskHelper.GetDateTimeObject(agencyBankConfig.startTime);
            
            BackgroundJob.Schedule<IAgencyBanks>(x => x.ProcessTask(), agencyBankDate.Value);

            Log.Information("Schedule {serviceName} BackgroundJob.", agencyBankConfig.processName);
        }
Example #7
0
        public void ScheduleStartOfDayProcess(SchedulerReference schedulerReference)
        {
            var sodConfig = schedulerReference.GetSchedulerDetailByProcessName(SchedulerProcess.StartOfDay);

            var startTime = TaskHelper.GetDateTimeObject(sodConfig.startTime);

            //Start Of Day
            RecurringJob.AddOrUpdate<IStartOfDay>(sodConfig.processName,
              y => y.ProcessTask(),
              Cron.Daily(startTime.Value.Hour, startTime.Value.Minute),
              TimeZoneInfo.Local);

            Log.Information("AddOrUpdate {serviceName} RecurringJob.", sodConfig.processName);
        }