From 9838e34fb4a2b6b97f087b1d159430855a79775b Mon Sep 17 00:00:00 2001 From: Andrew Pham <32873177+adpham95@users.noreply.github.com> Date: Thu, 7 Mar 2019 11:30:32 -0500 Subject: [PATCH] disabled buggy storage of attributes in redis. this is getting fixed in 1.0 --- apps/__init__.py | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/apps/__init__.py b/apps/__init__.py index 3ec298085..ad1a230b9 100644 --- a/apps/__init__.py +++ b/apps/__init__.py @@ -106,29 +106,29 @@ def __setstate__(self, state): self.__dict__.update(state) self.__dict__['_cache'] = make_cache(walkoff.config.Config.CACHE) - def __getattribute__(self, item): - try: - return object.__getattribute__(self, item) - except AttributeError: - key = self._format_cache_key(item) - if not self._cache.exists(key): - raise AttributeError - else: - obj = self._cache.get(key) - return dill.loads(obj) - - def __setattr__(self, key, value): - if key in _reserved_fields: - self.__dict__[key] = value - elif key.startswith('__') and key.endswith('__'): - super(App, self).__setattr__(key, value) - else: - value = dill.dumps(value) - key = self._format_cache_key(key) - self._cache.set(key, value) +# def __getattribute__(self, item): +# try: +# return object.__getattribute__(self, item) +# except AttributeError: +# key = self._format_cache_key(item) +# if not self._cache.exists(key): +# raise AttributeError +# else: +# obj = self._cache.get(key) +# return dill.loads(obj) + +# def __setattr__(self, key, value): +# if key in _reserved_fields: +# self.__dict__[key] = value +# elif key.startswith('__') and key.endswith('__'): +# super(App, self).__setattr__(key, value) +# else: +# value = dill.dumps(value) +# key = self._format_cache_key(key) +# self._cache.set(key, value) @classmethod def from_cache(cls, app, device, context): base = App(app, device, context) base.__class__ = cls - return base \ No newline at end of file + return base