forked from TrueCloudLab/distribution
commit
b1993c9530
1 changed files with 3 additions and 3 deletions
|
@ -80,7 +80,7 @@ func getOutstandingUploads(ctx context.Context, driver storageDriver.StorageDriv
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uuid, isContainingDir := uUIDFromPath(filePath)
|
uuid, isContainingDir := uuidFromPath(filePath)
|
||||||
if uuid == "" {
|
if uuid == "" {
|
||||||
// Cannot reliably delete
|
// Cannot reliably delete
|
||||||
return nil
|
return nil
|
||||||
|
@ -111,10 +111,10 @@ func getOutstandingUploads(ctx context.Context, driver storageDriver.StorageDriv
|
||||||
return uploads, errors
|
return uploads, errors
|
||||||
}
|
}
|
||||||
|
|
||||||
// uUIDFromPath extracts the upload UUID from a given path
|
// uuidFromPath extracts the upload UUID from a given path
|
||||||
// If the UUID is the last path component, this is the containing
|
// If the UUID is the last path component, this is the containing
|
||||||
// directory for all upload files
|
// directory for all upload files
|
||||||
func uUIDFromPath(path string) (string, bool) {
|
func uuidFromPath(path string) (string, bool) {
|
||||||
components := strings.Split(path, "/")
|
components := strings.Split(path, "/")
|
||||||
for i := len(components) - 1; i >= 0; i-- {
|
for i := len(components) - 1; i >= 0; i-- {
|
||||||
if u, err := uuid.Parse(components[i]); err == nil {
|
if u, err := uuid.Parse(components[i]); err == nil {
|
||||||
|
|
Loading…
Reference in a new issue