Add closers for persistent store backend

This commit is contained in:
lash 2022-04-20 15:20:07 +00:00
parent 14f4cb23ae
commit d133832e73
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
3 changed files with 13 additions and 0 deletions

View File

@ -154,3 +154,7 @@ class SimpleFileStoreFactory:
if re.match(re_processedname, v):
r.append(v)
return r
def close(self):
pass

View File

@ -96,3 +96,7 @@ class RedisStoreFactory:
def add(self, k):
k = str(k)
return RedisStore(k, self.redis, binary=self.__binary)
def close(self):
self.redis.close()

View File

@ -119,3 +119,8 @@ class RocksDbStoreFactory:
def add(self, k):
k = str(k)
return RocksDbStore(k, self.db, binary=self.__binary)
def close(self):
self.db.close()