From 4dea8efe2558710685effff3618338b54db436a6 Mon Sep 17 00:00:00 2001
From: Gamelin Alexis <gamelin@synchrotron-soleil.fr>
Date: Wed, 25 Mar 2020 15:22:11 +0100
Subject: [PATCH] Add a forced flush() operation at each write

---
 tracking/monitors.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tracking/monitors.py b/tracking/monitors.py
index 6dcc526..af79efa 100644
--- a/tracking/monitors.py
+++ b/tracking/monitors.py
@@ -166,6 +166,7 @@ class Monitor(Element, metaclass=ABCMeta):
             slice_tuple = tuple(slice_list)
             self.file[self.group_name][key][slice_tuple] = self.__getattribute__(key)
         
+        self.file.flush()
         self.write_count += 1
         
     def to_buffer(self, object_to_save):
@@ -460,6 +461,7 @@ class BeamMonitor(Monitor):
                  self.write_count*self.buffer_size:(self.write_count+1) * 
                  self.buffer_size] = self.current
                  
+        self.file.flush() 
         self.write_count += 1
         
         
\ No newline at end of file
-- 
GitLab