Ocean-Data-Map-Project icon indicating copy to clipboard operation
Ocean-Data-Map-Project copied to clipboard

Map-box-tile API endpoint throws FileExistError

Open htmlboss opened this issue 6 years ago • 2 comments
trafficstars

image

htmlboss avatar Jul 03 '19 12:07 htmlboss

Weird. The directory creation is wrapped in an if:

    if not os.path.isdir(basedir):
      os.makedirs(basedir)

The directory that is created is used for multiple tiles (only zoom and x, the filename contains the y coordinate), so probably this is happening when multiple tiles from the same z and x are being requested at the same time (race condition)? Not sure how to approach this.

jamesprayner avatar Jul 04 '19 13:07 jamesprayner

Yeah race condition is possible. The exception itself is vague because it may be thrown when a file or directory already exists.

htmlboss avatar Jul 04 '19 18:07 htmlboss