1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Provider DB connections remain open instead of constantly open/close for misc db calls.

This commit is contained in:
echel0n 2014-07-19 14:16:05 -07:00
parent 267affa5e9
commit 423c09fd9e

View File

@ -74,10 +74,15 @@ class TVCache():
self.provider = provider
self.providerID = self.provider.getID()
self.providerDB = None
self.minTime = 10
def _getDB(self):
return CacheDBConnection(self.providerID)
# init provider database if not done already
if not self.providerDB:
self.providerDB = CacheDBConnection(self.providerID)
return self.providerDB
def _clearCache(self):
if self.shouldClearCache():