Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Unified Diff: gm/rebaseline_server/imagediffdb.py

Issue 211733004: rebaseline_server: delete invalid image files from local disk cache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rebaseline_server/imagediffdb.py
diff --git a/gm/rebaseline_server/imagediffdb.py b/gm/rebaseline_server/imagediffdb.py
index a53eb1fb96d1c704fe9410be2bfbe8b22c54864a..8328543c935d77bbdc011701d85356c78fe9270f 100644
--- a/gm/rebaseline_server/imagediffdb.py
+++ b/gm/rebaseline_server/imagediffdb.py
@@ -387,7 +387,10 @@ def _open_image(filepath):
try:
return Image.open(filepath)
except IOError:
- logging.error('IOError loading image file %s' % filepath)
+ # If we are unable to load an image from the file, delete it from disk
+ # and we will try to fetch it again next time. Fixes http://skbug.com/2247
+ logging.error('IOError loading image file %s ; deleting it.' % filepath)
+ os.remove(filepath)
borenet 2014/03/26 13:17:21 Is there a chance that the file may not exist? I
epoger 2014/03/26 13:38:12 I suppose it's possible. For the reason you menti
raise
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698