def run_mailer_in_parallel(mailer_config, aws_session, logger, max_num_processes): max_num_processes = int(max_num_processes) if max_num_processes < 1: raise Exception sqs_queue_processor = MailerSqsQueueProcessor(mailer_config, aws_session, logger) sqs_queue_processor.max_num_processes = max_num_processes sqs_queue_processor.run(parallel=True)
def run_c7n_mailer(logger): email_config_filepath = '/custodian/email/email-config.yml' email_config = yaml.load(get_file_contents(email_config_filepath), Loader=yaml.SafeLoader) session = boto3.Session() mailer_sqs_queue_processor = MailerSqsQueueProcessor( email_config, session, logger) mailer_sqs_queue_processor.run(parallel=False)
def run_mailer_in_parallel(mailer_config, aws_session, logger, max_num_processes): try: max_num_processes = int(max_num_processes) if max_num_processes < 1: raise Exception except: print('--max-num-processes must be an integer') return sqs_queue_processor = MailerSqsQueueProcessor(mailer_config, aws_session, logger) sqs_queue_processor.max_num_processes = max_num_processes sqs_queue_processor.run(parallel=True)