fix: return 0 usage when pTsdb is null
This commit is contained in:
parent
cbf5ddb002
commit
214df56e39
|
@ -1492,4 +1492,11 @@ void tsdbCacheSetCapacity(SVnode *pVnode, size_t capacity) {
|
||||||
|
|
||||||
size_t tsdbCacheGetCapacity(SVnode *pVnode) { return taosLRUCacheGetCapacity(pVnode->pTsdb->lruCache); }
|
size_t tsdbCacheGetCapacity(SVnode *pVnode) { return taosLRUCacheGetCapacity(pVnode->pTsdb->lruCache); }
|
||||||
|
|
||||||
size_t tsdbCacheGetUsage(SVnode *pVnode) { return taosLRUCacheGetUsage(pVnode->pTsdb->lruCache); }
|
size_t tsdbCacheGetUsage(SVnode *pVnode) {
|
||||||
|
size_t usage = 0;
|
||||||
|
if (pVnode->pTsdb != NULL) {
|
||||||
|
usage = taosLRUCacheGetUsage(pVnode->pTsdb->lruCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
return usage;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue