Skip to content

Commit

Permalink
fix(images): avoid OSError - to many open files
Browse files Browse the repository at this point in the history
Closes #145
  • Loading branch information
PaulHax committed Nov 19, 2024
1 parent 38393e1 commit fd8d43d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/nrtk_explorer/app/images/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def __init__(self, server):
)

def _load_image(self, dataset_id: str):
return self.server.context.dataset.get_image(int(dataset_id))
img = self.server.context.dataset.get_image(int(dataset_id))
img.load() # Avoid OSError(24, 'Too many open files')
return img

def get_image(self, dataset_id: str, **kwargs):
"""For cache side effects pass on_add_item and on_clear_item callbacks as kwargs"""
Expand Down

0 comments on commit fd8d43d

Please sign in to comment.