mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilibj] DataLogManager: Fix behavior when low on space (#6486)
Uses getUsableSpace in Java, matching how C++ determines available space (C++ calls it available, but they mean the same thing.) This fixes a bug where logs wouldn't get deleted due to incorrect available space detection. The DataLog thread now also checks if the state was marked as stopped after a call to StartLogFile.
This commit is contained in:
@@ -463,6 +463,9 @@ void DataLog::WriterThreadMain(std::string_view dir) {
|
||||
lock.unlock();
|
||||
StartLogFile(state);
|
||||
lock.lock();
|
||||
if (m_state == kStopped) {
|
||||
continue;
|
||||
}
|
||||
if (state.f != fs::kInvalidFile) {
|
||||
// Emit start and schema data records
|
||||
for (auto&& entryInfo : m_entries) {
|
||||
|
||||
Reference in New Issue
Block a user