diff --git a/emmett/__version__.py b/emmett/__version__.py index 159d48b8..0309ae29 100644 --- a/emmett/__version__.py +++ b/emmett/__version__.py @@ -1 +1 @@ -__version__ = "2.0.1" +__version__ = "2.0.2" diff --git a/emmett/cache.py b/emmett/cache.py index d41efce3..1876a585 100644 --- a/emmett/cache.py +++ b/emmett/cache.py @@ -399,7 +399,8 @@ def __init__( except ImportError: raise RuntimeError('no redis module found') self._cache = redis.Redis( - host=host, port=port, password=password, db=db, **kwargs) + host=host, port=port, password=password, db=db, **kwargs + ) def _dump_obj(self, value: Any) -> bytes: if isinstance(value, int): @@ -428,7 +429,10 @@ def get(self, key: str) -> Any: def set(self, key: str, value: Any, **kwargs): dumped = self._dump_obj(value) return self._cache.setex( - name=key, value=dumped, time=kwargs['duration']) + name=key, + time=kwargs['duration'], + value=dumped + ) @CacheHandler._key_prefix_ def clear(self, key: Optional[str] = None): diff --git a/emmett/sessions.py b/emmett/sessions.py index 1424f09c..9cac2875 100644 --- a/emmett/sessions.py +++ b/emmett/sessions.py @@ -222,8 +222,10 @@ def _delete_session(self): def _save_session(self, expiration): if current.session._modified: self.redis.setex( - self.prefix + current.session._sid, current.session._dump, - expiration) + self.prefix + current.session._sid, + expiration, + current.session._dump + ) else: self.redis.expire(self.prefix + current.session._sid, expiration) diff --git a/pyproject.toml b/pyproject.toml index 5f3ecc55..16e3ba69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "Emmett" -version = "2.0.1" +version = "2.0.2" description = "The web framework for inventors" authors = ["Giovanni Barillari "] license = "BSD-3-Clause"