canonicalwebteam.store-api 7.3.0__tar.gz → 7.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of canonicalwebteam.store-api might be problematic. Click here for more details.
- {canonicalwebteam_store_api-7.3.0 → canonicalwebteam_store_api-7.3.1}/PKG-INFO +4 -2
- {canonicalwebteam_store_api-7.3.0 → canonicalwebteam_store_api-7.3.1}/canonicalwebteam/stores_web_redis/utility.py +18 -6
- {canonicalwebteam_store_api-7.3.0 → canonicalwebteam_store_api-7.3.1}/pyproject.toml +1 -1
- {canonicalwebteam_store_api-7.3.0 → canonicalwebteam_store_api-7.3.1}/LICENSE +0 -0
- {canonicalwebteam_store_api-7.3.0 → canonicalwebteam_store_api-7.3.1}/README.md +0 -0
- {canonicalwebteam_store_api-7.3.0 → canonicalwebteam_store_api-7.3.1}/canonicalwebteam/__init__.py +0 -0
- {canonicalwebteam_store_api-7.3.0 → canonicalwebteam_store_api-7.3.1}/canonicalwebteam/exceptions.py +0 -0
- {canonicalwebteam_store_api-7.3.0 → canonicalwebteam_store_api-7.3.1}/canonicalwebteam/retry_utils.py +0 -0
- {canonicalwebteam_store_api-7.3.0 → canonicalwebteam_store_api-7.3.1}/canonicalwebteam/store_api/__init__.py +0 -0
- {canonicalwebteam_store_api-7.3.0 → canonicalwebteam_store_api-7.3.1}/canonicalwebteam/store_api/base.py +0 -0
- {canonicalwebteam_store_api-7.3.0 → canonicalwebteam_store_api-7.3.1}/canonicalwebteam/store_api/dashboard.py +0 -0
- {canonicalwebteam_store_api-7.3.0 → canonicalwebteam_store_api-7.3.1}/canonicalwebteam/store_api/devicegw.py +0 -0
- {canonicalwebteam_store_api-7.3.0 → canonicalwebteam_store_api-7.3.1}/canonicalwebteam/store_api/publishergw.py +0 -0
- {canonicalwebteam_store_api-7.3.0 → canonicalwebteam_store_api-7.3.1}/canonicalwebteam/stores_web_redis/__init__.py +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: canonicalwebteam.store-api
|
|
3
|
-
Version: 7.3.
|
|
3
|
+
Version: 7.3.1
|
|
4
4
|
Summary:
|
|
5
5
|
License: LGPL-3.0
|
|
6
|
+
License-File: LICENSE
|
|
6
7
|
Author: Canonical Web Team
|
|
7
8
|
Author-email: webteam@canonical.com
|
|
8
9
|
Requires-Python: >=3.9,<4.0
|
|
@@ -13,6 +14,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
13
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
18
|
Requires-Dist: cachetools (>=6.2.0,<7.0.0)
|
|
17
19
|
Requires-Dist: coverage (>=7.0,<8.0)
|
|
18
20
|
Requires-Dist: mypy (>=1.14.1,<2.0.0)
|
|
@@ -89,12 +89,20 @@ class RedisCache:
|
|
|
89
89
|
full_key = self._build_key(key)
|
|
90
90
|
if self.redis_available:
|
|
91
91
|
try:
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
return self._deserialize(
|
|
93
|
+
self.client.get(full_key), expected_type
|
|
94
|
+
)
|
|
94
95
|
except redis.RedisError as e:
|
|
95
96
|
logger.error("Redis get error: %s", e)
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
else:
|
|
98
|
+
try:
|
|
99
|
+
return self._deserialize(
|
|
100
|
+
self.fallback[full_key], expected_type
|
|
101
|
+
)
|
|
102
|
+
except KeyError:
|
|
103
|
+
return None
|
|
104
|
+
except Exception as e:
|
|
105
|
+
logger.error("Fallback cache get error: %s", e)
|
|
98
106
|
|
|
99
107
|
def set(
|
|
100
108
|
self,
|
|
@@ -103,14 +111,18 @@ class RedisCache:
|
|
|
103
111
|
ttl=300,
|
|
104
112
|
):
|
|
105
113
|
full_key = self._build_key(key)
|
|
114
|
+
serialized = self._serialize(value)
|
|
106
115
|
if self.redis_available:
|
|
107
116
|
try:
|
|
108
|
-
serialized = self._serialize(value)
|
|
109
117
|
self.client.setex(full_key, ttl, serialized)
|
|
110
118
|
return
|
|
111
119
|
except redis.RedisError as e:
|
|
112
120
|
logger.error("Redis set error: %s", e)
|
|
113
|
-
|
|
121
|
+
else:
|
|
122
|
+
try:
|
|
123
|
+
self.fallback[full_key] = serialized
|
|
124
|
+
except Exception as e:
|
|
125
|
+
logger.error("Fallback cache set error: %s", e)
|
|
114
126
|
|
|
115
127
|
def delete(self, key: Union[str, tuple[str, Optional[dict[str, Any]]]]):
|
|
116
128
|
full_key = self._build_key(key)
|
|
File without changes
|
|
File without changes
|
{canonicalwebteam_store_api-7.3.0 → canonicalwebteam_store_api-7.3.1}/canonicalwebteam/__init__.py
RENAMED
|
File without changes
|
{canonicalwebteam_store_api-7.3.0 → canonicalwebteam_store_api-7.3.1}/canonicalwebteam/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|