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
|
||||
"""
|
||||
env = Environment(TEMP_ENV)
|
||||
env.storage.delete(TEMP_ENV)
|
||||
env.storage.clean()
|
||||
env.cache.clean()
|
||||
return Environment(TEMP_ENV)
|
||||
return env
|
||||
|
||||
@staticmethod
|
||||
def getGlobalEnv() -> 'Environment':
|
||||
|
@ -265,6 +265,9 @@ class Storage:
|
||||
for v in self.filter(attr1, forUpdate):
|
||||
yield (v[0], pickle.loads(v[1]), v[2])
|
||||
|
||||
def clean(self):
|
||||
self.delete(self._owner)
|
||||
|
||||
@staticmethod
|
||||
def delete(owner: str) -> None:
|
||||
DBStorage.objects.filter(owner=owner).delete()
|
||||
|
Loading…
x
Reference in New Issue
Block a user