MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / clearAsync

Method clearAsync

src/StorageCache.cpp:43–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void StorageCache::clearAsync()
44{
45 std::unique_lock<fastlock> ul(m_lock);
46 if (count() == 0)
47 return;
48 if (m_pdict != nullptr) {
49 dict *dSav = m_pdict;
50 m_pdict = dictCreate(&dbStorageCacheType, nullptr);
51 g_pserver->asyncworkqueue->AddWorkFunction([dSav]{
52 dictEmpty(dSav, nullptr);
53 });
54 }
55 m_spstorage->clear();
56 m_collisionCount = 0;
57}
58
59void StorageCache::cacheKey(sds key)
60{

Callers 2

processChangesMethod · 0.80
emptyDbAsyncMethod · 0.80

Calls 4

dictEmptyFunction · 0.85
AddWorkFunctionMethod · 0.80
dictCreateFunction · 0.70
clearMethod · 0.45

Tested by

no test coverage detected