mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
refactor(http): implement bufio (#1604)
* fix: misc http fixes * feat(io): implement bufio around syscalls * peek-a-boo * this can't be right. * you better be wearing a helmet * jesus christ. * refactor(notifications): check err on non-ok status * fix(notifications): add missing name method * refactor(indexer): api clients * fix(indexer): ptp test --------- Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
parent
d13b421c42
commit
cc0cca9f0d
22 changed files with 465 additions and 304 deletions
|
@ -20,6 +20,7 @@ type NotificationRepo interface {
|
|||
type NotificationSender interface {
|
||||
Send(event NotificationEvent, payload NotificationPayload) error
|
||||
CanSend(event NotificationEvent) bool
|
||||
Name() string
|
||||
}
|
||||
|
||||
type Notification struct {
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
package domain
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
|
@ -535,7 +536,7 @@ func (r *Release) downloadTorrentFile(ctx context.Context) error {
|
|||
}
|
||||
|
||||
// Read the body into bytes
|
||||
bodyBytes, err := io.ReadAll(resp.Body)
|
||||
bodyBytes, err := io.ReadAll(bufio.NewReader(resp.Body))
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "error reading response body")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue