示例#1
0
    def _add_dao_queue_members_on_update(self):
        old_queue_member_ids = set(
            self._queue_member_manager.get_queue_members_id())
        new_queue_member_ids = set()
        add_queue_members = []

        with session_scope():
            for dao_queue_member in queue_member_dao.get_queue_members_for_queues(
            ):
                queue_name = dao_queue_member.queue_name
                member_name = dao_queue_member.member_name
                queue_member_id = format_queue_member_id(
                    queue_name, member_name)
                new_queue_member_ids.add(queue_member_id)
                if queue_member_id not in old_queue_member_ids:
                    queue_member = QueueMember.from_dao_queue_member(
                        dao_queue_member)
                    add_queue_members.append(queue_member)

        for queue_member in add_queue_members:
            self._queue_member_manager._add_queue_member(queue_member)
            self._ask_member_queue_status(queue_member)

        obsolete_queue_member_ids = old_queue_member_ids - new_queue_member_ids
        return obsolete_queue_member_ids
示例#2
0
 def _add_dao_queue_members_on_init(self):
     with session_scope():
         queue_members = [
             QueueMember.from_dao_queue_member(row)
             for row in queue_member_dao.get_queue_members_for_queues()
         ]
     for queue_member in queue_members:
         self._queue_member_manager._add_queue_member(queue_member)
示例#3
0
 def _add_dao_queue_members_on_update(self):
     old_queue_member_ids = set(self._queue_member_manager.get_queue_members_id())
     new_queue_member_ids = set()
     for dao_queue_member in queue_member_dao.get_queue_members_for_queues():
         queue_name = dao_queue_member.queue_name
         member_name = dao_queue_member.member_name
         queue_member_id = format_queue_member_id(queue_name, member_name)
         new_queue_member_ids.add(queue_member_id)
         if queue_member_id not in old_queue_member_ids:
             queue_member = QueueMember.from_dao_queue_member(dao_queue_member)
             self._queue_member_manager._add_queue_member(queue_member)
             self._ask_member_queue_status(queue_member)
     obsolete_queue_member_ids = old_queue_member_ids - new_queue_member_ids
     return obsolete_queue_member_ids
示例#4
0
 def _add_dao_queue_members_on_init(self):
     for dao_queue_member in queue_member_dao.get_queue_members_for_queues(
     ):
         queue_member = QueueMember.from_dao_queue_member(dao_queue_member)
         self._queue_member_manager._add_queue_member(queue_member)
示例#5
0
 def _add_dao_queue_members_on_init(self):
     for dao_queue_member in queue_member_dao.get_queue_members_for_queues():
         queue_member = QueueMember.from_dao_queue_member(dao_queue_member)
         self._queue_member_manager._add_queue_member(queue_member)