Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
9bc5864a
Unverified
Commit
9bc5864a
authored
Oct 26, 2023
by
Michael Yang
Committed by
GitHub
Oct 26, 2023
Browse files
Merge pull request #918 from jmorganca/mxyng/fix-out-of-space
fix(download): no retry when out of space
parents
b88cc0fa
910816a5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
server/download.go
server/download.go
+3
-1
No files found.
server/download.go
View file @
9bc5864a
...
@@ -15,6 +15,7 @@ import (
...
@@ -15,6 +15,7 @@ import (
"strings"
"strings"
"sync"
"sync"
"sync/atomic"
"sync/atomic"
"syscall"
"time"
"time"
"golang.org/x/sync/errgroup"
"golang.org/x/sync/errgroup"
...
@@ -158,7 +159,8 @@ func (b *blobDownload) run(ctx context.Context, requestURL *url.URL, opts *Regis
...
@@ -158,7 +159,8 @@ func (b *blobDownload) run(ctx context.Context, requestURL *url.URL, opts *Regis
w
:=
io
.
NewOffsetWriter
(
file
,
part
.
StartsAt
())
w
:=
io
.
NewOffsetWriter
(
file
,
part
.
StartsAt
())
err
:=
b
.
downloadChunk
(
inner
,
requestURL
,
w
,
part
,
opts
)
err
:=
b
.
downloadChunk
(
inner
,
requestURL
,
w
,
part
,
opts
)
switch
{
switch
{
case
errors
.
Is
(
err
,
context
.
Canceled
)
:
case
errors
.
Is
(
err
,
context
.
Canceled
),
errors
.
Is
(
err
,
syscall
.
ENOSPC
)
:
// return immediately if the context is canceled or the device is out of space
return
err
return
err
case
err
!=
nil
:
case
err
!=
nil
:
log
.
Printf
(
"%s part %d attempt %d failed: %v, retrying"
,
b
.
Digest
[
7
:
19
],
i
,
try
,
err
)
log
.
Printf
(
"%s part %d attempt %d failed: %v, retrying"
,
b
.
Digest
[
7
:
19
],
i
,
try
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment