[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:
Gold856
2024-04-21 23:34:05 -04:00
committed by GitHub
parent 7bc0380694
commit 3e5187ff32
2 changed files with 5 additions and 2 deletions

View File

@@ -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) {