def send_messages(self, email_messages): connection = get_connection() for message in email_messages: message.connection = None enqueue(manage_message, message, connection=connection) return len(email_messages)
def send_messages(self, email_messages): for message in email_messages: enqueue(manage_message, message, connection=get_connection()) return len(email_messages)