chore(deps): update all dependencies and GitHub Actions to latest
- Go deps: cobra 1.10.2, fatih/color 1.19, tablewriter 1.1.4, anacrolix/torrent 1.61, charmbracelet/huh 1.0, pion/webrtc 4.2.11 - GitHub Actions: checkout v6, setup-go v6, golangci-lint-action v9, codecov-action v5, ghaction-upx v4, goreleaser-action v7 - CI matrix: drop Go 1.22, test on 1.24 + 1.25 - Migrate tablewriter API from v0 to v1 (breaking change) - Fix data race in WSTransport.readLoop (pass conn as parameter) - Add file.Sync() before close in debrid and usenet downloaders - Improve progress tracker: dedup MarkDone, re-mark dirty on flush error
This commit is contained in:
parent
719429b06e
commit
c9bcb96dab
10 changed files with 346 additions and 352 deletions
|
|
@ -79,7 +79,7 @@ func (t *WSTransport) Connect(ctx context.Context) error {
|
|||
t.authDoneOnce = sync.Once{}
|
||||
t.mu.Unlock()
|
||||
|
||||
go t.readLoop()
|
||||
go t.readLoop(conn)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -240,9 +240,9 @@ func (t *WSTransport) send(msg any) error {
|
|||
return t.conn.WriteMessage(websocket.TextMessage, data)
|
||||
}
|
||||
|
||||
func (t *WSTransport) readLoop() {
|
||||
func (t *WSTransport) readLoop(conn *websocket.Conn) {
|
||||
for {
|
||||
_, msg, err := t.conn.ReadMessage()
|
||||
_, msg, err := conn.ReadMessage()
|
||||
if err != nil {
|
||||
if !t.closed.Load() {
|
||||
log.Printf("[ws] read error: %v", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue