From 57397cd077f431be15df5a5fb44b28637f146891 Mon Sep 17 00:00:00 2001
From: iFA <ifa@fusionsolutions.io>
Date: Mon, 22 Apr 2019 20:45:29 +0200
Subject: [PATCH] Update _rocksdb.pyx

---
 rocksdb/_rocksdb.pyx | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/rocksdb/_rocksdb.pyx b/rocksdb/_rocksdb.pyx
index edd856a..cb06c6e 100644
--- a/rocksdb/_rocksdb.pyx
+++ b/rocksdb/_rocksdb.pyx
@@ -1258,6 +1258,9 @@ cdef class Options(ColumnFamilyOptions):
         for key, value in kwargs.items():
             setattr(self, key, value)
 
+    def IncreaseParallelism(self, int total_threads=16):
+        self.opts.IncreaseParallelism(total_threads)
+
     property create_if_missing:
         def __get__(self):
             return self.opts.create_if_missing
@@ -1671,11 +1674,8 @@ cdef class DB(object):
         self.opts.in_use = True
 
     def __dealloc__(self):
-        self.close()
-        
-    def close(self):
         cdef ColumnFamilyOptions copts
-        if not self.db == NULL:
+        if self.db != NULL:
             # We have to make sure we delete the handles so rocksdb doesn't
             # assert when we delete the db
             self.cf_handles.clear()
@@ -1683,12 +1683,13 @@ cdef class DB(object):
                 if copts:
                     copts.in_use = False
             self.cf_options.clear()
-
+    
             with nogil:
                 del self.db
 
-        if self.opts is not None:
-            self.opts.in_use = False
+            if self.opts is not None:
+                self.opts.in_use = False
+
 
     @property
     def column_families(self):
-- 
GitLab