forked from shaba/openuds
Fixed big mistake on storage
This commit is contained in:
parent
2acc72a1f7
commit
49ee75d986
@ -146,9 +146,9 @@ class Environment:
|
|||||||
It will not make environment persistent
|
It will not make environment persistent
|
||||||
"""
|
"""
|
||||||
env = Environment(TEMP_ENV)
|
env = Environment(TEMP_ENV)
|
||||||
env.storage.delete(TEMP_ENV)
|
env.storage.clean()
|
||||||
env.cache.clean()
|
env.cache.clean()
|
||||||
return Environment(TEMP_ENV)
|
return env
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getGlobalEnv() -> 'Environment':
|
def getGlobalEnv() -> 'Environment':
|
||||||
|
@ -265,6 +265,9 @@ class Storage:
|
|||||||
for v in self.filter(attr1, forUpdate):
|
for v in self.filter(attr1, forUpdate):
|
||||||
yield (v[0], pickle.loads(v[1]), v[2])
|
yield (v[0], pickle.loads(v[1]), v[2])
|
||||||
|
|
||||||
|
def clean(self):
|
||||||
|
self.delete(self._owner)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def delete(owner: str) -> None:
|
def delete(owner: str) -> None:
|
||||||
DBStorage.objects.filter(owner=owner).delete()
|
DBStorage.objects.filter(owner=owner).delete()
|
||||||
|
Loading…
Reference in New Issue
Block a user