0

emit a warning (but don't crash!) on unexpected empty tiles

This commit is contained in:
Aaron Griffith
2013-07-25 14:15:19 -04:00
parent fd057b819d
commit f87dcee6f1

View File

@@ -1040,7 +1040,12 @@ class TileSet(object):
raise raise
tile_mtime = 0 tile_mtime = 0
try:
max_chunk_mtime = max(c[5] for c in get_chunks_by_tile(tileobj, self.regionset)) max_chunk_mtime = max(c[5] for c in get_chunks_by_tile(tileobj, self.regionset))
except ValueError:
# max got an empty sequence! something went horribly wrong
logging.warning("tile %s expected contains no chunks! this may be a bug", path)
max_chunk_mtime = 0
if tile_mtime > 120 + max_chunk_mtime: if tile_mtime > 120 + max_chunk_mtime:
# If a tile has been modified more recently than any of its # If a tile has been modified more recently than any of its