backend2/src/core/email.py
def send_message_from_queue(self) -> bool:
        """Find a new message in the queue and send it.

        Returns False if queue is empty
        """
        message: MessageQueue = self._db.query(MessageQueue) \
            .filter(MessageQueue.status == MessageStatus.NEW) \
            .with_for_update(skip_locked=True, key_share=True) \
            .first()

        if not message:
            return False

        try:
            self.send_message(message.to, message.subject, message.contents)  # TODO: Handle errors
        finally:
            message.status = MessageStatus.OK
            self._db.commit()

        return True
Find a new message in the queue and send it.

        Returns False if queue is empty
        
Find a new message in the queue and send it.
Returns False if queue is empty
Find a new message in the queue and send it . Returns False if queue is empty
def send_message_from_queue(self) -> bool:
        message: MessageQueue = self._db.query(MessageQueue) \
            .filter(MessageQueue.status == MessageStatus.NEW) \
            .with_for_update(skip_locked=True, key_share=True) \
            .first()
        if not message:
            return False
        try:
            self.send_message(message.to, message.subject, message.contents)  
        finally:
            message.status = MessageStatus.OK
            self._db.commit()
        return True
def send_message_from_queue ( self ) -> bool : message : MessageQueue = self . _db . query ( MessageQueue ) . filter ( MessageQueue . status == MessageStatus . NEW ) . with_for_update ( skip_locked = True , key_share = True ) . first ( ) if not message : return False try : self . send_message ( message . to , message . subject , message . contents ) finally : message . status = MessageStatus . OK self . _db . commit ( ) return True
Find a new message in the queue and send it.
Find a new message in the queue and send it .
"""Find a new message in the queue and send it.

        Returns False if queue is empty
        """ # TODO: Handle errors
self