TODOs
This commit is contained in:
parent
6f1c39fd21
commit
bc33f69877
@ -48,7 +48,7 @@ void Cache::push(unique_ptr<Block> block) {
|
|||||||
void Cache::_popOldEntries() {
|
void Cache::_popOldEntries() {
|
||||||
lock_guard<mutex> lock(_mutex);
|
lock_guard<mutex> lock(_mutex);
|
||||||
while(_cachedBlocks.size() > 0 && _cachedBlocks.peek()->ageSeconds() > PURGE_LIFETIME_SEC) {
|
while(_cachedBlocks.size() > 0 && _cachedBlocks.peek()->ageSeconds() > PURGE_LIFETIME_SEC) {
|
||||||
_cachedBlocks.pop();
|
_cachedBlocks.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,8 +11,7 @@
|
|||||||
namespace blockstore {
|
namespace blockstore {
|
||||||
namespace caching {
|
namespace caching {
|
||||||
|
|
||||||
//TODO Test
|
// A class that is a queue and a map at the same time. We could also see it as an addressable queue.
|
||||||
//TODO Move to utils
|
|
||||||
template<class Key, class Value>
|
template<class Key, class Value>
|
||||||
class QueueMap {
|
class QueueMap {
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user