Skip to content
Snippets Groups Projects
Commit d76345c4 authored by Giovanna Lazzari Miotto's avatar Giovanna Lazzari Miotto :mushroom:
Browse files

fix: sink: Move file close call out of assertion

parent 718f1fb4
No related branches found
No related tags found
1 merge request!109Introduce pipeline synchronization, output template and parallel sink
......@@ -5,6 +5,14 @@
#include "sink.h"
#include <tbb/concurrent_queue.h>
#include <cassert>
#include <fstream>
#include "OutputFile.h"
#include "log.h"
template class Sink<FileOutput>;
template <typename TOutput>
......@@ -31,7 +39,8 @@ void Sink<TOutput>::CommitOutput(const TOutput &f) {
auto file = reinterpret_cast<const FileOutput &>(f);
auto filename = file.GetFilename();
LOG(TRACE) << "Closing file '" << filename << "'";
assert(file.Close());
auto is_closed = file.Close();
assert(is_closed);
auto from = file.GetWorkingPath() + "/" + filename;
auto to = GetRootPath() + file.GetDestinationDir() + "/" + filename;
if (rename(from.c_str(), to.c_str()) != 0) {
......
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