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

This commit is contained in:
Thijs Hekman 2023-06-21 11:00:38 +02:00
parent 839ca4f77c
commit 30ce35d29b

View File

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