Skip to content

Commit

Permalink
fix: 🐛 fix restarting (add sleep)
Browse files Browse the repository at this point in the history
  • Loading branch information
onionj committed Feb 23, 2024
1 parent 2366fcc commit 14c96e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion muxr/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,13 @@ func (c *Client) StartForever() (closer func(), err error) {
fmt.Println("muxr StartForEver: closed")
return
default:
time.Sleep(time.Second / 50)
time.Sleep(time.Second / 10)
if c.isClosed {
fmt.Println("muxr StartForEver: restarting")
err = c.Start()
if err != nil {
fmt.Println("muxr StartForEver error:", err)
time.Sleep(time.Second * 2)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion muxr/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package muxr
import "errors"

const (
VERSION string = "v0.4.1"
VERSION string = "v0.4.2"
NUM_BYTES_HEADER = 7
TYPE_INITIAL uint8 = 1 // 0000 0001
TYPE_DATA uint8 = 2 // 0000 0010
Expand Down

0 comments on commit 14c96e8

Please sign in to comment.