Add delay-retry loop for handling temporarily locked image file writes
This commit is contained in:
parent
6efbf3a3df
commit
e584e3202b
3 changed files with 34 additions and 5 deletions
|
|
@ -281,7 +281,7 @@ public class FlatMap extends MapType {
|
|||
if(!outputFile.getParentFile().exists())
|
||||
outputFile.getParentFile().mkdirs();
|
||||
try {
|
||||
ImageIO.write(im.buf_img, "png", outputFile);
|
||||
FileLockManager.imageIOWrite(im.buf_img, "png", outputFile);
|
||||
} catch (IOException e) {
|
||||
Debug.error("Failed to save image: " + outputFile.getPath(), e);
|
||||
} catch (java.lang.NullPointerException e) {
|
||||
|
|
@ -308,7 +308,7 @@ public class FlatMap extends MapType {
|
|||
if(!dayfile.getParentFile().exists())
|
||||
dayfile.getParentFile().mkdirs();
|
||||
try {
|
||||
ImageIO.write(im_day.buf_img, "png", dayfile);
|
||||
FileLockManager.imageIOWrite(im_day.buf_img, "png", dayfile);
|
||||
} catch (IOException e) {
|
||||
Debug.error("Failed to save image: " + dayfile.getPath(), e);
|
||||
} catch (java.lang.NullPointerException e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue