-
Notifications
You must be signed in to change notification settings - Fork 10
APP-9929 respect etags in resumable downloads #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
outline: |
utils/utils_test.go
Outdated
|
|
||
| func TestPartialPath(t *testing.T) { | ||
| path := CreatePartialPath("https://storage.googleapis.com/packages.viam.com/apps/viam-server/viam-server-latest-x86_64") | ||
| path, _ := CreatePartialPath("https://storage.googleapis.com/packages.viam.com/apps/viam-server/viam-server-latest-x86_64") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on L395 below, can you add another line testing the etag path as well as the partial path?
utils/utils.go
Outdated
|
|
||
| return path.Join(ViamDirs.Partials, hashString(rawURL, 7), last(strings.Split(urlPath, "/"), "")+".part") | ||
| partPath = path.Join(ViamDirs.Partials, hashString(rawURL, 7), last(strings.Split(urlPath, "/"), "")+".part") | ||
| etagPath = partPath + ".etag" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here, can you do something like
basePath := path.Join(whatever)
partPath = basePath + ".part"
etagPath = basePath + ".etag"(so that the etag isn't .part.etag)
- Modified CreatePartialPath to return both .part and .etag paths - Added HEAD request to check remote ETag before downloading - Store ETag when starting downloads and check it when resuming - Delete partial file and start fresh if ETag mismatch detected - Updated tests to verify both partial and ETag path lengths
…syntax" This reverts commit 891d034.
No description provided.