}
/* Clear if full */
if (ret == KNOT_ESPACE) {
- /*
- * Commit empty transaction to make freed pages reclaimable
- * (This increases the txnid)
- */
- if (kr_cache_txn_begin(cache, &txn, 0) == 0) {
- kr_cache_txn_commit(&txn);
- }
- /* Now drop the database */
if (kr_cache_txn_begin(cache, &txn, 0) == 0) {
ret = kr_cache_clear(&txn);
if (ret == 0) {
/* Commit and format result. */
char *result = NULL;
- if (kr_cache_txn_commit(&txn) != 0) {
+ ret = kr_cache_txn_commit(&txn);
+ if (ret != 0) {
asprintf(&result, "{ \"pruned\": %d, \"error\": \"%s\" }", pruned, knot_strerror(ret));
} else {
asprintf(&result, "{ \"pruned\": %d }", pruned);