Skip to content

Commit

Permalink
block task if no data is read from http connection
Browse files Browse the repository at this point in the history
  • Loading branch information
kahrendt committed Nov 18, 2024
1 parent 23c7297 commit f19884c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion esphome/components/nabu/audio_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace nabu {
static const size_t READ_WRITE_TIMEOUT_MS = 20;

// The number of times the http read times out with no data before throwing an error
static const size_t ERROR_COUNT_NO_DATA_READ_TIMEOUT = 10;
static const size_t ERROR_COUNT_NO_DATA_READ_TIMEOUT = 50;

AudioReader::AudioReader(esphome::RingBuffer *output_ring_buffer, size_t transfer_buffer_size) {
this->output_ring_buffer_ = output_ring_buffer;
Expand Down Expand Up @@ -188,6 +188,7 @@ AudioReaderState AudioReader::http_read_() {
this->cleanup_connection_();
return AudioReaderState::FAILED;
}
vTaskDelay(pdMS_TO_TICKS(READ_WRITE_TIMEOUT_MS));
}
}
}
Expand Down

0 comments on commit f19884c

Please sign in to comment.