mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-13 17:16:42 +02:00
don't log repeated exceptions
This commit is contained in:
parent
9ec135e1b8
commit
8cf069642d
2 changed files with 16 additions and 3 deletions
|
@ -146,8 +146,8 @@ void ProcessStream::worker()
|
|||
{
|
||||
timeval tvChunk;
|
||||
std::unique_ptr<msg::PcmChunk> chunk(new msg::PcmChunk(sampleFormat_, pcmReadMs_));
|
||||
|
||||
setState(kPlaying);
|
||||
string lastException = "";
|
||||
|
||||
while (active_)
|
||||
{
|
||||
|
@ -208,11 +208,17 @@ void ProcessStream::worker()
|
|||
pcmListener_->onResync(this, currentTick - nextTick);
|
||||
nextTick = currentTick;
|
||||
}
|
||||
|
||||
lastException = "";
|
||||
}
|
||||
}
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
logE << "(ProcessStream) Exception: " << e.what() << std::endl;
|
||||
if (lastException != e.what())
|
||||
{
|
||||
logE << "(PipeStream) Exception: " << e.what() << std::endl;
|
||||
lastException = e.what();
|
||||
}
|
||||
process_->kill();
|
||||
if (!sleep(30000))
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue