dbshelve len should not be called
43 function calls in 183.099 CPU seconds
Ordered by: internal time, call count
List reduced from 27 to 20 due to restriction <20>
ncalls tottime percall cumtime percall filename:lineno(function)
1 183.098 183.098 183.098 183.098 dbshelve.py:116(__len__)
11 0.001 0.000 0.001 0.000 lockeddbshelve.py:154(close)
1 0.000 0.000 0.000 0.000 util.py:169(xterm_title)
1 0.000 0.000 183.099 183.099 api.py:126(finalize)
7 0.000 0.000 0.000 0.000 itembyrepodb.py:41(close)
This commit is contained in:
@@ -194,7 +194,7 @@ componentdb = None
|
||||
|
||||
def init():
|
||||
global componentdb
|
||||
if componentdb:
|
||||
if componentdb is not None:
|
||||
return componentdb
|
||||
|
||||
componentdb = ComponentDB()
|
||||
@@ -202,6 +202,6 @@ def init():
|
||||
|
||||
def finalize():
|
||||
global componentdb
|
||||
if componentdb:
|
||||
if componentdb is not None:
|
||||
componentdb.close()
|
||||
componentdb = None
|
||||
|
||||
+2
-2
@@ -76,7 +76,7 @@ filesdb = None
|
||||
|
||||
def init():
|
||||
global filesdb
|
||||
if filesdb:
|
||||
if filesdb is not None:
|
||||
return filesdb
|
||||
|
||||
filesdb = FilesDB()
|
||||
@@ -84,6 +84,6 @@ def init():
|
||||
|
||||
def finalize():
|
||||
global filesdb
|
||||
if filesdb:
|
||||
if filesdb is not None:
|
||||
filesdb.close()
|
||||
filesdb = None
|
||||
|
||||
@@ -197,7 +197,7 @@ db = None
|
||||
|
||||
def init():
|
||||
global db
|
||||
if db:
|
||||
if db is not None:
|
||||
return db
|
||||
|
||||
db = InstallDB()
|
||||
@@ -205,6 +205,6 @@ def init():
|
||||
|
||||
def finalize():
|
||||
global db
|
||||
if db:
|
||||
if db is not None:
|
||||
db.close()
|
||||
db = None
|
||||
|
||||
@@ -183,11 +183,16 @@ pkgdb = None
|
||||
|
||||
def init():
|
||||
global pkgdb
|
||||
|
||||
if pkgdb is not None:
|
||||
return pkgdb
|
||||
|
||||
pkgdb = PackageDB()
|
||||
return pkgdb
|
||||
|
||||
def finalize():
|
||||
global pkgdb
|
||||
if pkgdb:
|
||||
|
||||
if pkgdb is not None:
|
||||
pkgdb.close()
|
||||
pkgdb = None
|
||||
|
||||
+2
-2
@@ -110,7 +110,7 @@ db = None
|
||||
def init():
|
||||
global db
|
||||
|
||||
if db:
|
||||
if db is not None:
|
||||
return db
|
||||
|
||||
db = RepoDB()
|
||||
@@ -119,6 +119,6 @@ def init():
|
||||
def finalize():
|
||||
global db
|
||||
|
||||
if db:
|
||||
if db is not None:
|
||||
db.close()
|
||||
db = None
|
||||
|
||||
+2
-2
@@ -93,7 +93,7 @@ srcdb = None
|
||||
|
||||
def init():
|
||||
global srcdb
|
||||
if srcdb:
|
||||
if srcdb is not None:
|
||||
return srcdb
|
||||
|
||||
srcdb = SourceDB()
|
||||
@@ -101,6 +101,6 @@ def init():
|
||||
|
||||
def finalize():
|
||||
global srcdb
|
||||
if srcdb:
|
||||
if srcdb is not None:
|
||||
srcdb.close()
|
||||
srcdb = None
|
||||
|
||||
Reference in New Issue
Block a user