lalithadevi commited on
Commit
1600839
1 Parent(s): 79227de

Update db_operations/db_operations.py

Browse files
Files changed (1) hide show
  1. db_operations/db_operations.py +2 -0
db_operations/db_operations.py CHANGED
@@ -19,6 +19,7 @@ class DBOperations:
19
  _ = self.__client.list_database_names()
20
  except Exception as conn_exception:
21
  self.__error = 1
 
22
  self.__client = None
23
  raise
24
 
@@ -31,6 +32,7 @@ class DBOperations:
31
  coll.insert_many(documents=documents)
32
  except Exception as insert_err:
33
  self.__error = 1
 
34
  raise
35
 
36
  def __close_connection(self):
 
19
  _ = self.__client.list_database_names()
20
  except Exception as conn_exception:
21
  self.__error = 1
22
+ self.__close_connection()
23
  self.__client = None
24
  raise
25
 
 
32
  coll.insert_many(documents=documents)
33
  except Exception as insert_err:
34
  self.__error = 1
35
+ self.__close_connection()
36
  raise
37
 
38
  def __close_connection(self):