Example #1
0
		private static void RunEuroCourseJob(string connectionString)
		{
			var serializer = new Serializer();
			var executor = new SqlProcedureExecutor(connectionString);
			var settings = new SettingRepository(executor, serializer);
			var httpClient = new HttpClient();
			var emailMessageRepository = new EmailMessageRepository(executor);
			var mailSender = new DbMailSender(PartitionIdForOtherMails, emailMessageRepository, serializer);
			var courseSource = new CourseSourceFailPolicy(
				new CourseSourceRetryPolicy(
					new CourseSource(httpClient),
					CourseSourceAttempts,
					JobsLogger,
					CourseSourceRetryPolicyPeriod),
				mailSender,
				EmailsHelper.DefaultFrom,
				EmailsHelper.SupportEmail);

			new EuroCourseJob(settings, courseSource, serializer, PreviousRunEuroCourseJobRubTime).Work();
		}
Example #2
0
		private static DefaultEmailingProcessor GetDefaultEmailingProcessor(
			int partitionId,
			ISqlProcedureExecutor executor,
			IMessageBuilder messageBuilder)
		{
			var emails = new EmailMessageRepository(executor);
			var mailSender = new DbMailSender(partitionId, emails, new Serializer());

			return new DefaultEmailingProcessor(mailSender, messageBuilder);
		}