Function
CompactionLevelForBlocks
(blockMetas []*backend.BlockMeta)
Source from the content-addressed store, hash-verified
| 412 | } |
| 413 | |
| 414 | func CompactionLevelForBlocks(blockMetas []*backend.BlockMeta) uint8 { |
| 415 | level := uint8(0) |
| 416 | |
| 417 | for _, m := range blockMetas { |
| 418 | if m.CompactionLevel > uint32(level) { |
| 419 | level = uint8(m.CompactionLevel) |
| 420 | } |
| 421 | } |
| 422 | |
| 423 | return level |
| 424 | } |
| 425 | |
| 426 | // doForAtLeast executes the function f. It blocks for at least the passed duration but can go longer. if context is cancelled after |
| 427 | // the function is done we will bail immediately. in the current use case this means that the process is shutting down |
Tested by
no test coverage detected