File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ class MCAPSink : public DataSinkBase
25
25
* @brief MCAPSink.
26
26
* IMPORTANT: if you want the recorder to be more robust to crash/segfault,
27
27
* set `do_compression` to false.
28
- * Compression is dafe if your application is closing cleanly.
28
+ * Compression is safe if your application is closing cleanly.
29
29
*
30
30
* @param filepath path of the file to be saved. Should have extension ".mcap"
31
31
* @param do_compression if true, compress the data on the fly.
@@ -40,6 +40,8 @@ class MCAPSink : public DataSinkBase
40
40
41
41
// / After a certain amount of time, the MCAP file will be reset
42
42
// / and overwritten. Default value is 600 seconds (10 minutes)
43
+ // / To disable this feature, use a time of 0 seconds.
44
+ // / WARNING: this can consume a large amount of disk space very quickly.
43
45
void setMaxTimeBeforeReset (std::chrono::seconds reset_time);
44
46
45
47
// / Stop recording and save the file
@@ -67,6 +69,7 @@ class MCAPSink : public DataSinkBase
67
69
std::chrono::system_clock::time_point start_time_;
68
70
69
71
bool forced_stop_recording_ = false ;
72
+ bool unlimited_recording_ = false ;
70
73
std::recursive_mutex mutex_;
71
74
72
75
void openFile (std::string const & filepath);
Original file line number Diff line number Diff line change 1
1
#include " data_tamer/sinks/mcap_sink.hpp"
2
2
#include " data_tamer/contrib/SerializeMe.hpp"
3
3
4
+ #include < chrono>
4
5
#include < sstream>
5
6
#include < mutex>
6
7
@@ -118,7 +119,7 @@ bool MCAPSink::storeSnapshot(const Snapshot& snapshot)
118
119
// If reset_time_ is exceeded, we want to overwrite the current file.
119
120
// Better than filling the disk, if you forgot to stop the application.
120
121
auto const now = std::chrono::system_clock::now ();
121
- if (now - start_time_ > reset_time_)
122
+ if (reset_time_ != std::chrono::seconds ( 0 ) && now - start_time_ > reset_time_)
122
123
{
123
124
restartRecording (filepath_, compression_);
124
125
}
You can’t perform that action at this time.
0 commit comments