WithKeepBlocksInCache returns a new Option value with KeepBlocksInCache set to the given value. When this option is set badger will store the block in the cache. The size of the cache is determined by the MaxCacheSize option.If the MaxCacheSize is set to zero, then MaxCacheSize is set to 100 mb. T
(val bool)
| 689 | // |
| 690 | // The default value of KeepBlocksInCache is false. |
| 691 | func (opt Options) WithKeepBlocksInCache(val bool) Options { |
| 692 | opt.KeepBlocksInCache = val |
| 693 | |
| 694 | if val && opt.MaxCacheSize == 0 { |
| 695 | opt.MaxCacheSize = 100 << 20 |
| 696 | } |
| 697 | return opt |
| 698 | } |
no outgoing calls