forked from TrueCloudLab/frostfs-contract
[#215] container/tests: add tests for container size estimation
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
53f102344f
commit
7bca6bf782
3 changed files with 147 additions and 21 deletions
|
@ -61,7 +61,8 @@ const (
|
|||
|
||||
estimateKeyPrefix = "cnr"
|
||||
estimatePostfixSize = 10
|
||||
cleanupDelta = 3
|
||||
// CleanupDelta contains number last epochs for which container estimations are present.
|
||||
CleanupDelta = 3
|
||||
|
||||
// NotFoundError is returned if container is missing.
|
||||
NotFoundError = "container does not exist"
|
||||
|
@ -780,7 +781,7 @@ func cleanupContainers(ctx storage.Context, epoch int) {
|
|||
|
||||
var n interface{} = nbytes
|
||||
|
||||
if epoch-n.(int) > cleanupDelta {
|
||||
if epoch-n.(int) > CleanupDelta {
|
||||
storage.Delete(ctx, k)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue