コード例 #1
0
        public static string PrepareCronType(CronSelectorModel model)
        {
            switch (model.CronType)
            {
            case CronType.Daily:
                return(Cron.Daily(model.Hour, model.Minute));

            case CronType.Hourly:
                return(Cron.Hourly(model.Minute));

            case CronType.Minutely:
                return(Cron.Minutely());

            case CronType.Monthly:
                return(Cron.Monthly(model.Day, model.Hour, model.Minute));

            case CronType.Weekly:
                return(Cron.Weekly(DayOfWeek.Monday, model.Hour, model.Minute));

            case CronType.Yearly:
                return(Cron.Yearly(model.Month, model.Day, model.Hour, model.Minute));
            }

            return(string.Empty);
        }
        /// <summary>
        /// Get the cron expression from the recurring options
        /// </summary>
        /// <param name="recurringOptions"></param>
        /// <returns></returns>
        private string GetCronExpression(RecurringOption recurringOptions)
        {
            var cronExpression = string.Empty;

            recurringOptions.Day = recurringOptions.Day == 0 ? 1 : recurringOptions.Day;

            switch (recurringOptions.Recurrence)
            {
            case Recurrence.Daily:
                cronExpression = Cron.Daily(recurringOptions.Hour, recurringOptions.Minute);
                break;

            case Recurrence.Hourly:
                cronExpression = Cron.Hourly(recurringOptions.Minute);
                break;

            case Recurrence.Minutely:
                cronExpression = Cron.Minutely();
                break;

            case Recurrence.Monthly:
                cronExpression = Cron.Monthly(recurringOptions.Day, recurringOptions.Hour, recurringOptions.Minute);
                break;

            case Recurrence.Weekly:
                cronExpression = Cron.Weekly(recurringOptions.DayOfWeek, recurringOptions.Hour, recurringOptions.Minute);
                break;

            case Recurrence.Yearly:
                cronExpression = Cron.Yearly(recurringOptions.Month, recurringOptions.Day, recurringOptions.Hour, recurringOptions.Minute);
                break;
            }

            return(cronExpression);
        }
コード例 #3
0
 public static void InitializeJobs()
 {
     RecurringJob.AddOrUpdate <SendPaymentReminder>(job => job.Execute(), Cron.Monthly(25, 12));
     RecurringJob.AddOrUpdate <SendLeaseReminder>(job => job.Execute(), Cron.Daily(12));
     RecurringJob.AddOrUpdate <testReminder>(job => job.Execute(), Cron.Daily(15));
     RecurringJob.AddOrUpdate <SendDepositReminder>(job => job.Execute(), Cron.Daily(15));
 }
コード例 #4
0
        public void IniciarJob(IndicadorAutomaticoViewModel indicadorAutomatico)
        {
            switch (indicadorAutomatico.CategoriaIndicadorAutomatico)
            {
            case Enums.Enum.CategoriaIndicadorAutomatico.CPI:
                RecurringJob.AddOrUpdate <IndicadorAutomaticoCPIStrategy>(
                    indicadorAutomatico.Nombre,
                    x => x.EjecutarIndicador(indicadorAutomatico.IndicadorViewModel),
                    //Cron.Minutely);
                    Cron.Monthly(5, 1, 0));    // El 5 de cada mes a la 1:00 a.m.
                break;

            case Enums.Enum.CategoriaIndicadorAutomatico.CPI_Servicios:
                RecurringJob.AddOrUpdate <IndicadorAutomaticoCPIServiciosStrategy>(
                    indicadorAutomatico.Nombre,
                    x => x.EjecutarIndicador(indicadorAutomatico.IndicadorViewModel),
                    //Cron.Minutely);
                    Cron.Monthly(5, 1, 15));    // El 5 de cada mes a la 1:15 a.m.
                break;

            case Enums.Enum.CategoriaIndicadorAutomatico.CPI_Llave_En_Mano:
                RecurringJob.AddOrUpdate <IndicadorAutomaticoCPILlaveManoStrategy>(
                    indicadorAutomatico.Nombre,
                    x => x.EjecutarIndicador(indicadorAutomatico.IndicadorViewModel),
                    //Cron.Minutely);
                    Cron.Monthly(5, 1, 30));    // El 5 de cada mes a la 1:30 a.m.
                break;
            }
        }
コード例 #5
0
        public void Monthly_WithoutDayHourMinute_ReturnsFormattedStringWithDefaults()
        {
            string expected = "0 0 1 * *";
            string actual   = Cron.Monthly();

            Assert.Equal(expected, actual);
        }
コード例 #6
0
        public void GetDescription_CronMonthlyWithDay_ReturnsAtMidnightOnDay5()
        {
            string expected = "At 00:00 AM, on day 5 of the month";
            string actual   = Cron.GetDescription(Cron.Monthly(5));

            Assert.Equal(expected, actual);
        }
コード例 #7
0
ファイル: HangfireJob.cs プロジェクト: radtek/ReportMS
        // 执行的时间表。关于 CRON 详细信息,见 https://en.wikipedia.org/wiki/Cron#CRON_expression
        private string ConvertToCronExpression(ScheduleCronOptions cronOptions)
        {
            switch (cronOptions.scheduleCron)
            {
            case ScheduleCron.Minutely:
                return(Cron.Minutely());

            case ScheduleCron.Hourly:
                return(Cron.Hourly(cronOptions.Minute));

            case ScheduleCron.Daily:
                return(Cron.Daily(cronOptions.Hour, cronOptions.Minute));

            case ScheduleCron.Weekly:
                return(Cron.Weekly((DayOfWeek)cronOptions.Week, cronOptions.Hour, cronOptions.Minute));

            case ScheduleCron.Monthly:
                return(Cron.Monthly(cronOptions.Day, cronOptions.Hour, cronOptions.Minute));

            case ScheduleCron.Yearly:
                return(Cron.Yearly(cronOptions.Month, cronOptions.Day, cronOptions.Hour, cronOptions.Minute));

            default:
                throw new InvalidOperationException("Can not convert the scheduleCronOptions to cron.");
            }
        }
コード例 #8
0
        public void Configuration(IAppBuilder app)
        {
            ConfigureAuth(app);

            app.UseHangfireAspNet(GetHangfireConfiguration);
            app.UseHangfireDashboard("/hangfire", new DashboardOptions
            {
                Authorization = new IDashboardAuthorizationFilter[0]
            });

            IIndicadorAutomaticoService indicadorAutomaticoService = (IIndicadorAutomaticoService)KernelNinject.GetService(typeof(IIndicadorAutomaticoService));

            indicadorAutomaticoService.GenerarJobsTareasAutomaticas();

            RecurringJob.AddOrUpdate <NotificacionService>(
                "NotificarCarga",
                x => x.NotificarCarga(),
                //Cron.Minutely);
                Cron.Monthly(1, 2, 0)); // Cada 1º de mes a las 2 a.m.

            RecurringJob.AddOrUpdate <NotificacionService>(
                "NotificarMetas",
                x => x.NotificarMetas(),
                //Cron.Minutely);
                Cron.Daily(3, 0)); // Cada día a las 3 a.m.

            RecurringJob.AddOrUpdate <AnioTableroService>(
                "ProcesoHabilitarAnioSiguiente",
                x => x.ProcesoHabilitarAnioSiguiente(),
                Cron.Yearly(12, 31, 23, 0));
        }
コード例 #9
0
        public void GetDescription_CronMonthlyWithDayHourMinute_ReturnsAtFiveFifteenAMOnDay5()
        {
            string expected = "At 05:15 AM, on day 5 of the month";
            string actual   = Cron.GetDescription(Cron.Monthly(5, 5, 15));

            Assert.Equal(expected, actual);
        }
コード例 #10
0
        public void GenerarJobsTareasAutomaticas()
        {
            IList <IndicadorAutomaticoViewModel> indicadoresAutomaticos = this.Todos();

            foreach (IndicadorAutomaticoViewModel indicadorAutomatico in indicadoresAutomaticos)
            {
                switch (indicadorAutomatico.CategoriaIndicadorAutomatico)
                {
                case Enums.Enum.CategoriaIndicadorAutomatico.CPI:
                    RecurringJob.AddOrUpdate <IndicadorAutomaticoCPIStrategy>(
                        indicadorAutomatico.Nombre,
                        x => x.EjecutarIndicador(indicadorAutomatico.IndicadorViewModel),
                        //Cron.Minutely);
                        Cron.Monthly(5, 1, 0));    // El 5 de cada mes a la 1:00 a.m.
                    break;

                case Enums.Enum.CategoriaIndicadorAutomatico.CPI_Servicios:
                    RecurringJob.AddOrUpdate <IndicadorAutomaticoCPIServiciosStrategy>(
                        indicadorAutomatico.Nombre,
                        x => x.EjecutarIndicador(indicadorAutomatico.IndicadorViewModel),
                        //Cron.Minutely);
                        Cron.Monthly(5, 1, 15));    // El 5 de cada mes a la 1:15 a.m.
                    break;

                case Enums.Enum.CategoriaIndicadorAutomatico.CPI_Llave_En_Mano:
                    RecurringJob.AddOrUpdate <IndicadorAutomaticoCPILlaveManoStrategy>(
                        indicadorAutomatico.Nombre,
                        x => x.EjecutarIndicador(indicadorAutomatico.IndicadorViewModel),
                        //Cron.Minutely);
                        Cron.Monthly(5, 1, 30));    // El 5 de cada mes a la 1:30 a.m.
                    break;
                }
            }
        }
コード例 #11
0
        /// <summary>
        /// Static method to start the recurring job.
        /// </summary>
        public static void StartRecurringJob()
        {
            var cronPeriod = Environment.GetEnvironmentVariable("MORPHIC_CHECK_STALE_USERS_CRON_PERIOD");

            if (string.IsNullOrWhiteSpace(cronPeriod))
            {
                cronPeriod = DefaultCronPeriod;
            }
            switch (cronPeriod.ToLower())
            {
            case "disabled":
                // don't run the job. Delete if exists.
                RecurringJob.RemoveIfExists(JobId);
                return;

            case "daily":
                cronPeriod = Cron.Daily();
                break;

            case "weekly":
                cronPeriod = Cron.Weekly(DayOfWeek.Sunday);
                break;

            case "monthly":
                cronPeriod = Cron.Monthly();
                break;

            case "minutely":
                // probably only useful for development and or some rare situations!
                cronPeriod = Cron.Minutely();
                break;
            }
            RecurringJob.AddOrUpdate <UserCleanupJob>(JobId,
                                                      userCleanup => userCleanup.DeleteStaleUsers(), cronPeriod);
        }
コード例 #12
0
        public void Monthly_WithoutHourMinuteWithDay_ReturnsFormattedStringWithDay()
        {
            int    day      = 6;
            string expected = "0 0 " + day.ToString() + " * *";
            string actual   = Cron.Monthly(day);

            Assert.Equal(expected, actual);
        }
コード例 #13
0
 /// <summary>
 /// hangfire初始化
 /// </summary>
 public static void Start()
 {
     RecurringJob.AddOrUpdate <IHangfireBackJob>(job => job.CheckLinks(), "0 */5 * * *");                                               //每5h检查友链
     RecurringJob.AddOrUpdate <IHangfireBackJob>(job => job.EverydayJob(), Cron.Daily(5), TimeZoneInfo.Local);                          //每天的任务
     RecurringJob.AddOrUpdate <IHangfireBackJob>(job => job.CreateLuceneIndex(), Cron.Weekly(DayOfWeek.Monday, 5), TimeZoneInfo.Local); //每周的任务
     RecurringJob.AddOrUpdate <IHangfireBackJob>(job => job.EverymonthJob(), Cron.Monthly(1, 0, 0), TimeZoneInfo.Local);                //每月的任务
     RecurringJob.AddOrUpdate <IHangfireBackJob>(job => job.StatisticsSearchKeywords(), Cron.Hourly);                                   //每小时的任务
     BackgroundJob.Enqueue <IHangfireBackJob>(job => job.StatisticsSearchKeywords());
 }
コード例 #14
0
        public void Monthly_WithoutMinuteWithDayHour_ReturnsFormattedStringWithDayHour()
        {
            int    day      = 7;
            int    hour     = 4;
            string expected = "0 " + hour.ToString() + " " + day.ToString() + " * *";
            string actual   = Cron.Monthly(day, hour);

            Assert.Equal(expected, actual);
        }
コード例 #15
0
ファイル: TaskQuest.cs プロジェクト: adouv/CGT.API
 public void InitTaskList()
 {
     #region 逾期宽限期利息计算
     //每天0点05分中计算所有账单的逾期宽限期利息,冻结企业状态,计算分销逾期和宽限期次数
     RecurringJob.AddOrUpdate(() => OverDueMonthlyBill.Execute(), Cron.Daily(0, 5), TimeZoneInfo.Local);
     //每个月1号0点9分执行保险月限额恢复
     RecurringJob.AddOrUpdate(() => updateMonthlylimitCountService.Execute(), Cron.Monthly(1, 0, 9), TimeZoneInfo.Local);
     #endregion
 }
コード例 #16
0
 /// <summary>
 /// hangfire初始化
 /// </summary>
 public static void Start()
 {
     RecurringJob.AddOrUpdate(() => CheckLinks(), "0 */5 * * *");                                          //每5h检查友链
     RecurringJob.AddOrUpdate(() => EverydayJob(), Cron.Daily(5), TimeZoneInfo.Local);                     //每天的任务
     RecurringJob.AddOrUpdate(() => EveryweekJob(), Cron.Weekly(DayOfWeek.Monday, 5), TimeZoneInfo.Local); //每周的任务
     RecurringJob.AddOrUpdate(() => EverymonthJob(), Cron.Monthly(1, 0, 0), TimeZoneInfo.Local);           //每月的任务
     RecurringJob.AddOrUpdate(() => EveryHourJob(), Cron.Hourly);                                          //每小时的任务
     BackgroundJob.Enqueue(() => HangfireHelper.CreateJob(typeof(IHangfireBackJob), nameof(HangfireBackJob.StatisticsSearchKeywords), "default"));
 }
コード例 #17
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     JobStorage.Current = new SqlServerStorage(System.Configuration.ConfigurationManager.ConnectionStrings["DBConnection"].ConnectionString);
     RecurringJob.AddOrUpdate(() => ChangeService.Instance.ApplyChanges(), Cron.Monthly(1));
     RecurringJob.AddOrUpdate(() => EmailSenderService.Instance.Send(), Cron.Monthly(1));
     RecurringJob.AddOrUpdate(() => ChangeService.Instance.LockLicense(), Cron.Monthly(5));
 }
コード例 #18
0
        public void Configuration(IAppBuilder app)
        {
            GlobalConfiguration.Configuration.UseSqlServerStorage("PTODataConnectionString");

            app.UseHangfireDashboard();
            app.UseHangfireServer();

            RecurringJob.AddOrUpdate("AutoAccrue", () => AutoAccrue(), Cron.Monthly(1));
            RecurringJob.AddOrUpdate("ConvertRequestsToHistory", () => ConvertRequestsToHistory(), Cron.Daily(8));
        }
コード例 #19
0
        public void Monthly_WithDayHourMinute_ReturnsFormattedStringWithDayHourMinute()
        {
            int    day      = 7;
            int    hour     = 4;
            int    minute   = 23;
            string expected = minute.ToString() + " " + hour.ToString() + " " + day.ToString() + " * *";
            string actual   = Cron.Monthly(day, hour, minute);

            Assert.Equal(expected, actual);
        }
コード例 #20
0
 public static void Schedule()
 {
     RecurringJob
     .AddOrUpdate <IAtualizarEstoqueJob>(
         recurringJobId:  "AtualizarEstoque",
         methodCall:      job => job.Run(),
         cronExpression:  Cron.Monthly(14)
         //cronExpression:  "0 0 0/1 ? * SUN,SAT *"
         //timeZone:        TimeZoneInfo.FindSystemTimeZoneById("America/Fortaleza")
         );
 }
コード例 #21
0
ファイル: JobService.cs プロジェクト: Aldiger/PropertyCrawler
        public async Task Job(List <PostalCode> postalCodes, PropertyType propertyType, ProcessType processType, bool isScheduled, ScheduleInterval?scheduleInterval, ProxyIp proxyIp)
        {
            var process = InsertProcess(processType, propertyType);

            if (isScheduled)
            {
                var cron = Cron.Daily();
                switch (scheduleInterval)
                {
                case ScheduleInterval.Monthly:
                    cron = Cron.Monthly();
                    break;

                case ScheduleInterval.Daily:
                    cron = Cron.Daily();
                    break;

                case ScheduleInterval.Once_in_2_Days:
                    cron = Cron.DayInterval(2);
                    break;

                case ScheduleInterval.Once_in_4_Days:
                    cron = Cron.DayInterval(4);
                    break;

                case ScheduleInterval.Twice_a_Month:
                    cron = Cron.DayInterval(15);
                    break;

                case ScheduleInterval.Weekly:
                    cron = Cron.DayInterval(7);
                    break;

                default:
                    break;
                }

                RecurringJob.AddOrUpdate(
                    () => Recurrency(postalCodes, propertyType, process, proxyIp, processType),
                    cron);
            }
            else
            {
                var jobId = BackgroundJob.Enqueue(() => _crawlerService.Execute(postalCodes, propertyType, process, proxyIp, processType));
                if (int.TryParse(jobId, out int temp))
                {
                    UpdateProcess(temp, process);
                }
                //update process status
                BackgroundJob.ContinueJobWith(jobId, () => Execute(jobId, process.Id), JobContinuationOptions.OnAnyFinishedState);
            }
        }
コード例 #22
0
 private string GetCronExpression(RefreshFrequent refreshFrequent)
 {
     return(refreshFrequent switch
     {
         RefreshFrequent.Minutely => Cron.Minutely(),
         RefreshFrequent.Quarterly => "*/15 * * * *",
         RefreshFrequent.Hourly => Cron.Hourly(),
         RefreshFrequent.Daily => Cron.Daily(2),
         RefreshFrequent.Weekly => Cron.Weekly(),
         RefreshFrequent.Monthly => Cron.Monthly(),
         RefreshFrequent.Yearly => Cron.Yearly(),
         _ => throw new NotImplementedException()
     });
コード例 #23
0
        public void RunOnSchedule(int id, string name, string recurring, Dictionary <string, string> psParams)
        {
            var recurringSwitch = new Dictionary <string, string>
            {
                { "Minutely", Cron.Minutely() },
                { "Hourly", Cron.Hourly() },
                { "Weekly", Cron.Weekly() },
                { "Monthly", Cron.Monthly() },
                { "Yearly", Cron.Yearly() }
            };

            RecurringJob.AddOrUpdate(id.ToString(), () => Run(name, psParams), recurringSwitch[recurring]);
        }
コード例 #24
0
ファイル: JobServices.cs プロジェクト: PoeBlu/LaunchPad
        public void RunOnSchedule(int id, string name, string recurring, Dictionary <string, string> psParams, DateTime schedule)
        {
            var recurringSwitch = new Dictionary <string, string>
            {
                { "Minutely", Cron.Minutely() },
                { "Hourly", Cron.Hourly(schedule.Minute) },
                { "Daily", Cron.Daily(schedule.Hour, schedule.Minute) },
                { "Weekly", Cron.Weekly(schedule.DayOfWeek, schedule.Hour, schedule.Minute) },
                { "Monthly", Cron.Monthly(schedule.Day, schedule.Hour, schedule.Minute) },
                { "Yearly", Cron.Yearly(schedule.Month, schedule.Day, schedule.Hour, schedule.Minute) }
            };

            RecurringJob.AddOrUpdate <IJobServices>(id.ToString(), x => x.Run(name, psParams), recurringSwitch[recurring], TimeZoneInfo.Local);
        }
コード例 #25
0
        protected async void RegisterJobInHangfire(Job entity)
        {
            if (entity == null || entity.Project == null)
            {
                throw new UserFriendlyException("定时任务信息不完整");
            }

            var projectHost = entity.Project.Host;

            SendRequestJobArgs args = new SendRequestJobArgs()
            {
                JobId  = entity.Id,
                Host   = projectHost,
                ApiUrl = entity.ApiUrl
            };

            string cron = Cron.Daily();

            switch (entity.Frequency)
            {
            case FrequencyEnum.每分钟:
                cron = Cron.Minutely();
                break;

            case FrequencyEnum.每小时:
                cron = Cron.Hourly();
                break;

            case FrequencyEnum.每天:
                cron = Cron.Daily();
                break;

            case FrequencyEnum.每月:
                cron = Cron.Monthly();
                break;

            default:
                break;
            }

            if (!string.IsNullOrWhiteSpace(entity.Cron))
            {
                cron = entity.Cron;
            }

            RecurringJob.AddOrUpdate <SendRequestJob>(entity.Id.ToString(), e => e.Execute(args), cron, TimeZoneInfo.Local);
        }
コード例 #26
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }


            app.UseHttpsRedirection();
            app.UseMvc();

            app.UseHangfireServer();
            app.UseHangfireDashboard();

            Hangfire.RecurringJob.AddOrUpdate <StatementCreator>(j => j.Run(), Cron.Monthly(1, 4));
        }
コード例 #27
0
ファイル: Startup.cs プロジェクト: DevVeryMe/TripFlip
        public void Configure(IApplicationBuilder applicationBuilder, IWebHostEnvironment environment,
                              TripFlipDbContext tripFlipDbContext)
        {
            applicationBuilder.ConfigureExceptionHandler(environment);

            applicationBuilder.UseRouting();

            applicationBuilder.UseAuthentication();
            applicationBuilder.UseAuthorization();

            applicationBuilder.UseHangfireDashboard();
            RecurringJob.AddOrUpdate <IScheduledTaskService>(
                scheduledTask => scheduledTask.GreetBirthdayUsersAsync(),
                Cron.Daily(hour: 8));
            RecurringJob.AddOrUpdate <IScheduledTaskService>(
                scheduledTask => scheduledTask.SendUserStatisticAsync(),
                Cron.Monthly());

            applicationBuilder.UseHangfireServer();

            applicationBuilder.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

            var swaggerEndpointUrl = Configuration.GetSection("OpenApiInfo")["url"];
            var swaggerApiVersion  = Configuration.GetSection("OpenApiInfo")["version"];

            applicationBuilder.UseSwagger();
            applicationBuilder.UseSwaggerUI(options =>
            {
                options.SwaggerEndpoint(swaggerEndpointUrl, swaggerApiVersion);
                options.OAuthClientId(Configuration["GoogleApi:ClientId"]);
                options.OAuthClientSecret(Configuration["GoogleApi:ClientSecret"]);
                options.OAuthAppName("TripFlip");
                options.OAuthScopeSeparator(" ");
                options.OAuthUsePkce();
            });

            tripFlipDbContext.Database.Migrate();
        }
コード例 #28
0
        public JobReponse CreateMonthlyJob(MonthlyJobRequest request)
        {
            JobRequest jobRequest = jobRequestMapper.MapMonthlyJobRequest(request);
            JobReponse response   = new JobReponse();

            if (!DoesJobExist(jobRequest.JobName))
            {
                RecurringJob.AddOrUpdate(recurringJobId: jobRequest.JobName.ToLower(),
                                         methodCall: () => _jobRepo.CallWebServiceMethod(jobRequest.ServiceUrl, jobRequest.Controller, jobRequest.Action),
                                         cronExpression: Cron.Monthly((int)jobRequest.Day, jobRequest.Hour, jobRequest.Minute),
                                         timeZone: null,
                                         queue: "monthly"
                                         );
                response.Result = "Job Added";
            }
            else
            {
                response.Result = "Job Already Exists : " + jobRequest.JobName;
            }
            return(response);
        }
コード例 #29
0
        protected virtual string GetCron(int period)
        {
            var time = TimeSpan.FromSeconds(period /= 1000);
            var cron = "";

            if (time.TotalSeconds <= 59)
            {
                cron = $"*/{period} * * * * *";
            }
            else if (time.TotalMinutes <= 59)
            {
                cron = Cron.Hourly(time.Minutes);
            }
            else if (time.TotalHours <= 23)
            {
                cron = Cron.Daily(time.Hours, time.Minutes);
            }
            else
            {
                Cron.Monthly(time.Days, time.Hours, time.Minutes);
            }

            return(cron);
        }
コード例 #30
0
        private string MapjobFrequency(CronEnum occurence)
        {
            var frequency = Cron.Daily();

            switch (occurence)
            {
            case CronEnum.Daily:
                frequency = Cron.Daily();
                break;

            case CronEnum.Minutely:
                frequency = Cron.Minutely();
                break;

            case CronEnum.Hourly:
                frequency = Cron.Hourly();
                break;

            case CronEnum.Weekly:
                frequency = Cron.Weekly();
                break;

            case CronEnum.Monthly:
                frequency = Cron.Monthly();
                break;

            case CronEnum.Yearly:
                frequency = Cron.Yearly();
                break;

            default:
                break;
            }

            return(frequency);
        }