tilezen / joerd

Joerd can be used to download, merge and generate tiles from digital elevation data
MIT License
324 stars 50 forks source link

Remove Unneeded Cached DEMs #49

Closed kevinkreiser closed 8 years ago

kevinkreiser commented 8 years ago

..when the current job needs more space than you have.

This fixes #40.

The way it works is by having each datasource generate a list of its cached DEMs, we then subtract from this set the set required by the current job. What remains is a list of DEMs that we could remove if we need the space. We save this list in shared memory and in a synchronized manner, we delete these files when the unpack operation fails.

We still need to catch just the exception thrown by unpacking to a full disk though. I'm still testing this so its not quite ready yet. Just wanted to show the diff for easier debugging.

zerebubuth commented 8 years ago

:+1: looks good to me.