Merge "Catch exception when image cache pruning"
This commit is contained in:
commit
0e8773c14a
@ -280,8 +280,12 @@ class Driver(base.Driver):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
path = self.get_image_filepath(image_id)
|
path = self.get_image_filepath(image_id)
|
||||||
file_info = os.stat(path)
|
try:
|
||||||
return image_id, file_info[stat.ST_SIZE]
|
file_info = os.stat(path)
|
||||||
|
size = file_info[stat.ST_SIZE]
|
||||||
|
except OSError:
|
||||||
|
size = 0
|
||||||
|
return image_id, size
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def open_for_write(self, image_id):
|
def open_for_write(self, image_id):
|
||||||
|
Loading…
Reference in New Issue
Block a user