Update _rocksdb.pyx

This commit is contained in:
iFA 2020-08-31 11:24:28 +02:00 committed by GitHub
parent 4bc9039ccc
commit 3f4e75f119
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1725,14 +1725,11 @@ cdef class DB(object):
def close(self, safe=True): def close(self, safe=True):
cdef ColumnFamilyOptions copts cdef ColumnFamilyOptions copts
# -- iFA88 --
cdef cpp_bool c_safe = safe cdef cpp_bool c_safe = safe
if self.db != NULL: if hasattr(self, "db"):
# -- iFA88 -- <<
# We need stop backround compactions # We need stop backround compactions
with nogil: with nogil:
db.CancelAllBackgroundWork(self.db, c_safe) db.CancelAllBackgroundWork(self.db, c_safe)
# -- iFA88 -- >>
# We have to make sure we delete the handles so rocksdb doesn't # We have to make sure we delete the handles so rocksdb doesn't
# assert when we delete the db # assert when we delete the db
del self.cf_handles[:] del self.cf_handles[:]