From b86459b24439f6c0f12a5de24eead8173c4ee47d Mon Sep 17 00:00:00 2001 From: Nonoo Date: Mon, 26 Oct 2020 19:46:08 +0100 Subject: [PATCH] Cleanup --- controlstream.go | 4 +++- seqbuf.go | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/controlstream.go b/controlstream.go index a864cfb..24f131d 100644 --- a/controlstream.go +++ b/controlstream.go @@ -13,6 +13,8 @@ const controlStreamPort = 50001 const serialStreamPort = 50002 const audioStreamPort = 50003 +const statusLogInterval = 3 * time.Second + type controlStream struct { common streamCommon serial serialStream @@ -237,7 +239,7 @@ func (s *controlStream) loop() { <-s.reauthTimeoutTimer.C reauthTicker := time.NewTicker(25 * time.Second) - statusLogTicker := time.NewTicker(3 * time.Second) + statusLogTicker := time.NewTicker(statusLogInterval) for { select { diff --git a/seqbuf.go b/seqbuf.go index 488e91c..761ac5b 100644 --- a/seqbuf.go +++ b/seqbuf.go @@ -217,8 +217,8 @@ func (s *seqBuf) watcher() { s.watcherCloseDoneChan <- true }() - entryAvailableTimer := time.NewTimer(s.length) - entryAvailableTimer.Stop() + entryAvailableTimer := time.NewTimer(0) + <-entryAvailableTimer.C var entryAvailableTimerRunning bool for {