예제 #1
0
 def handle(self):
     with closing(self.odb.session()) as session:
         item = pubsub_endpoint_queue(session, self.request.input.cluster_id, self.request.input.id)
         item.creation_time = datetime_from_ms(item.creation_time * 1000.0)
         if getattr(item, 'last_interaction_time', None):
             item.last_interaction_time = datetime_from_ms(item.last_interaction_time * 1000.0)
         self.response.payload = item
         self._add_queue_depths(session, self.response.payload)
예제 #2
0
    def handle(self):
        with closing(self.odb.session()) as session:
            item = pubsub_endpoint_queue(session, self.request.input.cluster_id, self.request.input.id)

            self._add_queue_depths(session, item)
            item.creation_time = datetime_from_ms(item.creation_time)
            if item.last_interaction_time:
                item.last_interaction_time = datetime_from_ms(item.last_interaction_time)

            self.response.payload = item