s3Storage: fix slice bounds out of range error (#3208)
This commit is contained in:
parent
c90929b544
commit
b2a80f2149
@ -200,7 +200,9 @@ func (s *S3Storage) Cleanup() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
s.deleteObjects(keys)
|
if len(keys) > 0 {
|
||||||
|
s.deleteObjects(keys)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -241,6 +243,10 @@ func (s *S3Storage) getDeletableVideoSegmentsWithOffset(offset int) ([]s3object,
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if offset > len(objectsToDelete)-1 {
|
||||||
|
offset = len(objectsToDelete) - 1
|
||||||
|
}
|
||||||
|
|
||||||
objectsToDelete = objectsToDelete[offset : len(objectsToDelete)-1]
|
objectsToDelete = objectsToDelete[offset : len(objectsToDelete)-1]
|
||||||
|
|
||||||
return objectsToDelete, nil
|
return objectsToDelete, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user