deepcopy cahced object before returing it
This commit is contained in:
parent
d0ce419ae0
commit
3cff5edffe
|
@ -1,5 +1,6 @@
|
||||||
import hashlib
|
import hashlib
|
||||||
import binascii
|
import binascii
|
||||||
|
import copy
|
||||||
from pymongo import MongoClient
|
from pymongo import MongoClient
|
||||||
|
|
||||||
class mongo(object):
|
class mongo(object):
|
||||||
|
@ -106,7 +107,7 @@ def cache(foo):
|
||||||
if hashed not in foo._mycache_.keys():
|
if hashed not in foo._mycache_.keys():
|
||||||
foo._mycache_[hashed] = foo(*args, **kwargs)
|
foo._mycache_[hashed] = foo(*args, **kwargs)
|
||||||
|
|
||||||
return foo._mycache_[hashed]
|
return copy.deepcopy(foo._mycache_[hashed])
|
||||||
|
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue