mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-04-23 17:10:44 +02:00
Fix writer stopping issue (SIGINT)
This commit is contained in:
@@ -16,7 +16,7 @@ using namespace std;
|
||||
|
||||
void write(WriterManager *manager, RingBuffer *ring_buffer, string output_file)
|
||||
{
|
||||
HDF5ChunkedWriter writer(output_file, config::dataset_name);
|
||||
HDF5ChunkedWriter writer(output_file, manager->get_parameters()["dataset_name"]);
|
||||
|
||||
// Run until the running flag is set or the ring_buffer is empty.
|
||||
while(manager->is_running() || !ring_buffer->is_empty()) {
|
||||
@@ -117,6 +117,9 @@ void run_writer(string connect_address, string output_file, uint64_t n_images, u
|
||||
cout << "[h5_zmq_writer::run_writer] Rest API stopped." << endl;
|
||||
#endif
|
||||
|
||||
// In case SIGINT stopped the rest_api.
|
||||
manager.stop();
|
||||
|
||||
receiver_thread.join();
|
||||
writer_thread.join();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user