Completed all flush statements. Now on Thijs machine, it looks like it does not crash anymore under normal circumstances
continuous-integration/drone/push Build is failing Details
continuous-integration/drone Build was killed Details

This commit is contained in:
Thijs Hekman 2023-06-21 11:00:38 +02:00
parent 839ca4f77c
commit 30ce35d29b
1 changed files with 4 additions and 0 deletions

View File

@ -85,6 +85,7 @@ class Recording:
try:
# Open the file
self.f = h5py.File(self.fn, "w", 'stdio')
self.f.flush()
except Exception as e:
logging.error(f'Error creating measurement file {e}')
raise
@ -151,6 +152,7 @@ class Recording:
# Measured physical quantity metadata
# This was how it was in LASP version < 1.0
# f.attrs['qtys'] = [ch.qty.to_json() for ch in in_ch]
f.flush()
def firstFrames(self, adata):
"""
@ -227,10 +229,12 @@ class Recording:
# instantaneously. For which we have to implement extra mutex
# guards in this class
del self.indh
self.indh = None
# Remove handle to dataset otherwise the h5 file is not closed
# properly.
del self.ad
self.ad = None
try:
# Close the recording file