@@ -40,7 +40,6 @@ class SimpleCache(object):
4040 _db_timeout = 3.0
4141 _db_read_timeout = 1.0
4242 _queue_limit = 100
43- _connections = []
4443
4544 def __init__ (self , folder = None , filename = None ):
4645 '''Initialize our caching class'''
@@ -97,9 +96,6 @@ def close(self):
9796 while self ._busy_tasks and not self .monitor .abortRequested ():
9897 self .monitor .waitForAbort (0.25 )
9998
100- for con in self ._connections :
101- con .close ()
102-
10399 self .kodi_log (f'CACHE: Closed { self ._sc_name } ' , 2 )
104100
105101 def __del__ (self ):
@@ -354,7 +350,7 @@ def _get_database(self, read_only=False):
354350 '''get reference to our sqllite _database - performs basic integrity check'''
355351 timeout = self ._db_read_timeout if read_only else self ._db_timeout
356352 try :
357- connection = sqlite3 .connect (self ._db_file , timeout = timeout , isolation_level = None , check_same_thread = False )
353+ connection = sqlite3 .connect (self ._db_file , timeout = timeout , isolation_level = None )
358354 connection .execute ('SELECT * FROM simplecache LIMIT 1' )
359355 return self ._set_pragmas (connection )
360356 except Exception as error :
@@ -378,7 +374,6 @@ def database_execute(database):
378374 # always use new db object because we need to be sure that data is available for other simplecache instances
379375 try :
380376 with self ._get_database (read_only = read_only ) as database :
381- self ._connections .append (database )
382377 return database_execute (database )
383378
384379 except Exception as database_exception :
0 commit comments