Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def add_error_filters(self, queue_store=None, daemon=False):
assert self.tilestream is not None
self.imap(LogErrors(
logger, logging.ERROR,
"Error in tile: %(tilecoord)s, %(formated_metadata)s, %(error)r"
))
if stats.BACKENDS:
def add_stats(tile):
if tile and tile.error:
stats.increment_counter(['error', tile.metadata.get('layer', 'None')])
return tile
self.imap(add_stats)
if 'error_file' in self.config['generation']:
def do(tile):
if tile and tile.error:
self.log_tiles_error(tile=tile, message=repr(tile.error))
return tile
self.imap(do)
if self.config['generation']['maxconsecutive_errors'] > 0 and not daemon:
self.tilestream = map(MaximumConsecutiveErrors(
self.config['generation']['maxconsecutive_errors']), self.tilestream)