MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / close

Method close

src/Db/Db.py:161–175  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

159 self.delayed_queue_thread = None
160
161 def close(self):
162 s = time.time()
163 if self.delayed_queue:
164 self.processDelayed()
165 if self in opened_dbs:
166 opened_dbs.remove(self)
167 self.need_commit = False
168 self.commit("Closing")
169 if self.cur:
170 self.cur.close()
171 if self.conn:
172 self.conn.close()
173 self.conn = None
174 self.cur = None
175 self.log.debug("%s closed in %.3fs, opened: %s" % (self.db_path, time.time() - s, len(opened_dbs)))
176
177 # Gets a cursor object to database
178 # Return: Cursor class

Callers 15

actionBenchmarkMethod · 0.95
prepareShutdownFunction · 0.45
stopMethod · 0.45
actionFileMethod · 0.45
all.jsFile · 0.45
dbCleanupFunction · 0.45
dbCloseAllFunction · 0.45
closeDbMethod · 0.45
getDbMethod · 0.45
rebuildDbMethod · 0.45
cleanupPeersMethod · 0.45
routeMethod · 0.45

Calls 3

processDelayedMethod · 0.95
commitMethod · 0.95
removeMethod · 0.80

Tested by 15

closeDbMethod · 0.36
getDbMethod · 0.36
rebuildDbMethod · 0.36
testPingMethod · 0.36
testDownloadFileMethod · 0.36
testOpenLockedMethod · 0.36
cleanupFunction · 0.36
file_server4Function · 0.36
file_server6Function · 0.36
stopFunction · 0.36
testGetFileMethod · 0.36
testStreamFileMethod · 0.36