v1.0.0 beta 10

This commit is contained in:
2026-03-06 12:12:16 +03:00
parent 9895edf966
commit f42d47af53
8 changed files with 43 additions and 24 deletions

View File

@@ -113,6 +113,9 @@ func (r UploaderRequest[R, P]) doRequest(ctx context.Context, up *Uploader) (R,
body, err := readBody(resp.Body)
_ = resp.Body.Close()
if err != nil {
return zero, err
}
up.logger.Debugln("UPLOADER RES", r.method, string(body))
response, err := parseBody[R](body)
@@ -145,7 +148,7 @@ func (r UploaderRequest[R, P]) doRequest(ctx context.Context, up *Uploader) (R,
func (r UploaderRequest[R, P]) DoWithContext(ctx context.Context, up *Uploader) (R, error) {
var zero R
result, err := up.api.pool.Submit(ctx, func(ctx context.Context) (any, error) {
result, err := up.api.pool.submit(ctx, func(ctx context.Context) (any, error) {
return r.doRequest(ctx, up)
})
if err != nil {
@@ -156,10 +159,10 @@ func (r UploaderRequest[R, P]) DoWithContext(ctx context.Context, up *Uploader)
case <-ctx.Done():
return zero, ctx.Err()
case res := <-result:
if res.Err != nil {
return zero, res.Err
if res.err != nil {
return zero, res.err
}
if val, ok := res.Value.(R); ok {
if val, ok := res.value.(R); ok {
return val, nil
}
return zero, ErrPoolUnexpected