Skip to content

Commit

Permalink
Attempt to fix truncated MVR files
Browse files Browse the repository at this point in the history
  • Loading branch information
bjhardcastle committed Mar 15, 2024
1 parent 12e76dc commit 478c376
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/np_workflows/shared/base_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,14 @@ def stop_recording_after_stim_finished(self,
stims = self.stims
while not all(_.is_ready_to_start() for _ in stims):
time.sleep(5)
is_first_mvr_file = True
for stoppable in (_ for _ in recorders if isinstance(_, Stoppable)):
if is_first_mvr_file and 'mvr' in stoppable.__name__.lower():
sleep_s = 4
time.sleep(sleep_s)
logger.warning(f'Waiting additional {sleep_s} s for MVR to finish writing...')
is_first_mvr_file = False
stoppable.stop()
if 'mvr' in stoppable.__class__.__name__.lower():
time.sleep(v := 3)
logger.info(f'Waiting additional {v}s for MVR to finish writing...')

def start_services(self, *services: Service) -> None:
if not services:
Expand Down

0 comments on commit 478c376

Please sign in to comment.