| 3140 | } |
| 3141 | |
| 3142 | void redisDbPersistentData::removeAllCachedValues() |
| 3143 | { |
| 3144 | // First we have to flush the tracked changes |
| 3145 | if (m_fTrackingChanges) |
| 3146 | { |
| 3147 | if (processChanges(false)) |
| 3148 | commitChanges(); |
| 3149 | trackChanges(false); |
| 3150 | } |
| 3151 | |
| 3152 | if (m_pdict->pauserehash == 0 && m_pdict->refcount == 1) { |
| 3153 | dict *dT = m_pdict; |
| 3154 | m_pdict = dictCreate(&dbDictType, this); |
| 3155 | dictExpand(m_pdict, dictSize(dT)/2, false); // Make room for about half so we don't excessively rehash |
| 3156 | g_pserver->asyncworkqueue->AddWorkFunction([dT]{ |
| 3157 | dictRelease(dT); |
| 3158 | }, false); |
| 3159 | } else { |
| 3160 | dictEmpty(m_pdict, nullptr); |
| 3161 | } |
| 3162 | } |
| 3163 | |
| 3164 | void redisDbPersistentData::disableKeyCache() |
| 3165 | { |
no test coverage detected