Skip to content
Snippets Groups Projects
Commit 1849d6e6 authored by Emilio Meschi's avatar Emilio Meschi :bicyclist_tone1: Committed by Thomas Owen James
Browse files

fix closing of file at end of run

parent 762fb1b8
No related branches found
No related tags found
No related merge requests found
......@@ -33,11 +33,18 @@ void OutputByOrbitStream::OutputFixedOrbits(Slice &out) {
control.output_force_write) { // i.e should be writing data
n = fwrite(out.begin(), 1, out.size(),
output_file_handler_.getFile(control.run_number, index));
current_file_size += n;
} else if (output_file_handler_.hasFile()) {
// the run has been stopped so drop but first check if there is a last
// file to close
LOG(TRACE) << "the run was stopped. queueing the last file for close and "
"rename ";
output_file_handler_.enqueue_current_file_for_close_and_move_maybe();
}
current_file_size += n;
} else { // i.e should not currently be writing data - but then we should
// never get here in the first place
output_file_handler_.enqueue_current_file_for_close_and_move_maybe();
LOG(TRACE) << "got an empty slice ";
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment