Пример #1
0
        public string GetCronExpression(IntervalType intervalType, int value)
        {
            switch (intervalType)
            {
            case IntervalType.Minutely:
                return(Cron.MinuteInterval(value));

            case IntervalType.Hourly:
                return(Cron.HourInterval(value));

            case IntervalType.Daily:
                return(Cron.DayInterval(value));

            case IntervalType.Monthly:
                return(Cron.MonthInterval(value));
            }

            throw new Exception("please select a valid interval type");
        }
Пример #2
0
        public void NotifyUnmergeablePullRequests(PerformContext context)
        {
            var gitHubService = new GitHubService();

            RecurringJob.AddOrUpdate(() => gitHubService.NotifyUnmergeablePullRequests(context), Cron.MonthInterval(12));
        }
Пример #3
0
        public void GetAllGitHubLabels(PerformContext context)
        {
            var gitHubService = new GitHubService();

            RecurringJob.AddOrUpdate(() => gitHubService.DownloadAllLabels(context), Cron.MonthInterval(12));
        }
Пример #4
0
        public void AddCommentToStateHQDiscussionIssues(PerformContext context)
        {
            var gitHubService = new GitHubService();

            RecurringJob.AddOrUpdate(() => gitHubService.AddCommentToStateHQDiscussionIssues(context), Cron.MonthInterval(12));
        }
Пример #5
0
        public void AddCommentToAwaitingFeedbackIssues(PerformContext context)
        {
            var gitHubService = new GitHubService();

            RecurringJob.AddOrUpdate(() => gitHubService.AddCommentToAwaitingFeedbackIssues(context), Cron.MonthInterval(12));
        }
Пример #6
0
 public static void StartJobs()
 {
     // Add job schedule based on Cron expression
     RecurringJob.AddOrUpdate(() => new GenerateBatch().Generate(), Cron.MonthInterval(3));
 }