def put_one(self, tile): try: self._redis.xadd(name=self._name, fields={'message': encode_message(tile)}) except Exception as e: logger.warning('Failed sending SQS message', exc_info=True) tile.error = e
def put_one(self, tile): try: self._master.xadd(name=self._name, fields={"message": encode_message(tile)}) except Exception as e: logger.warning("Failed sending Redis message", exc_info=True) tile.error = e
def _send_buffer(self, tiles): try: messages = [encode_message(tile) for tile in tiles] self._redis.rpush(self._name, *messages) except Exception as e: logger.warning('Failed sending Redis messages', exc_info=True) for tile in tiles: tile.error = e
def put_one(self, tile): sqs_message = encode_message(tile) try: self.queue.send_message(MessageBody=sqs_message) except Exception as e: logger.warning("Failed sending SQS message", exc_info=True) tile.error = e return tile
def put_one(self, tile): sqs_message = encode_message(tile) try: self.queue.send_message(MessageBody=sqs_message) except Exception as e: logger.warning('Failed sending SQS message', exc_info=True) tile.error = e return tile
def _send_buffer(self, tiles): try: messages = [{ 'Id': str(i), 'MessageBody': encode_message(tile) } for i, tile in enumerate(tiles)] response = self.queue.send_messages(Entries=messages) for failed in response.get('Failed', []): logger.warning('Failed sending SQS message: %s', failed['Message']) pos = int(failed['Id']) tiles[pos].error = failed['Message'] except Exception as e: logger.warning('Failed sending SQS messages', exc_info=True) for tile in tiles: tile.error = e
def _send_buffer(self, tiles): try: messages = [{ "Id": str(i), "MessageBody": encode_message(tile) } for i, tile in enumerate(tiles)] response = self.queue.send_messages(Entries=messages) for failed in response.get("Failed", []): logger.warning("Failed sending SQS message: %s", failed["Message"]) pos = int(failed["Id"]) tiles[pos].error = failed["Message"] except Exception as e: logger.warning("Failed sending SQS messages", exc_info=True) for tile in tiles: tile.error = e
def put_one(self, tile): try: self._redis.xadd(name=self._name, fields={'message': encode_message(tile)}) except Exception as e: logger.warning('Failed sending SQS message', exc_info=True) tile.error = e
def put_one(self, tile): try: self._redis.rpush(self._name, encode_message(tile)) except Exception as e: logger.warning('Failed sending SQS message', exc_info=True) tile.error = e