Skip to content

Commit

Permalink
Fixed __module__ and cache_pop errors
Browse files Browse the repository at this point in the history
  • Loading branch information
onuratakan committed Dec 26, 2023
1 parent ff3f0b9 commit ce4f5f2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions upsonic/remote/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ def active_module(self, module, encryption_key="a", compress=None):
name = element.__module__ +"." + element.__name__
first_element = name.split(".")[0]
if module.__name__ not in first_element:
name = module.__name__ + "." + name
name = module.__name__ + "." + name
element.__module__ = "__main__"
self.set(name, element, encryption_key=encryption_key, compress=compress)


Expand Down Expand Up @@ -216,7 +217,11 @@ def cache_get(self, key):
def cache_pop(self, key):
if key in self.local_cache:
self.local_cache.pop(key)
os.remove(f"{self.cache_dir}/{sha256(key.encode()).hexdigest()}")
try:
os.remove(f"{self.cache_dir}/{sha256(key.encode()).hexdigest()}")
except AttributeError:
pass



def _informations(self):
Expand Down

0 comments on commit ce4f5f2

Please sign in to comment.