Пример #1
0
 public BotController(ICommandService commandService, ITelegramBotClient telegramBotClient, BotContext context,
                      IStateService stateService, IBackgroundJobClient jobClient, INotificationJob notificationJob)
 {
     _db                = context;
     _commandService    = commandService;
     _stateService      = stateService;
     _jobClient         = jobClient;
     _notificationJob   = notificationJob;
     _telegramBotClient = telegramBotClient;
 }
Пример #2
0
 public SearchLogJob(
     IAppSettings appSettings,
     IDataAccess dataAccess,
     IJobManagement jobManagement,
     ISumoLogicLogRepository sumoLogicLogRepository,
     INotificationJob notificationJob)
 {
     _appSettings            = appSettings;
     _dataAccess             = dataAccess;
     _jobManagement          = jobManagement;
     _sumoLogicLogRepository = sumoLogicLogRepository;
     _notificationJob        = notificationJob;
 }
Пример #3
0
        public JobsManager(IRecurringJobManager recurringJobManager, NotificationJob notificationJob,
                           ISchedulerService schedulerService)
        {
            _recurringJobManager = recurringJobManager;
            _notificationJob     = notificationJob;
            _schedulerService    = schedulerService;
            _jobSchedules        = new List <JobSchedule>();

            var defaultRetryFilter = GlobalJobFilters.Filters
                                     .FirstOrDefault(f => f.Instance is AutomaticRetryAttribute);

            if (defaultRetryFilter?.Instance != null)
            {
                // Todo test notifications with multiple users
                // можливо, що розсилка буде надто повільна
                // todo усю логіку варто жорстко переглянути на діри
                // todo тествувати з великою кількістю користувачів
                GlobalJobFilters.Filters.Remove(defaultRetryFilter.Instance);
            }
            GlobalJobFilters.Filters.Add(new AutomaticRetryAttribute {
                Attempts = 0, OnAttemptsExceeded = AttemptsExceededAction.Delete
            });
        }
Пример #4
0
 public JobManager(IRecurringJobManager recurringJobManager, INotificationJob notificationJob)
 {
     _recurringJobManager = recurringJobManager;
     _notificationJob     = notificationJob;
 }