def _add_attachment_to_ews_queues(self, attachment): for queue in Queue.all_ews(): # all_ews() currently includes the style-queue if self._should_add_to_ews_queue(queue, attachment): queue.work_items().add_work_item(attachment.id) RecordPatchEvent.added(attachment.id, queue.name())
def test_style_queue_is_ews(self): # For now we treat the style-queue as an EWS since most users would # describe it as such. If is_ews() ever needs to mean "builds the patch" # or similar, then we will need to adjust all callers. self.assertTrue(Queue("style-queue").is_ews()) self.assertTrue("style-queue" in map(Queue.name, Queue.all_ews()))
def _add_attachment_to_ews_queues(self, attachment): for queue in Queue.all_ews(): if self._should_add_to_ews_queue(queue, attachment): queue.work_items().add_work_item(attachment.id)
def _check_processed_by_all_queues(attachment): return all( attachment.position_in_queue(queue) is None for queue in Queue.all_ews())