c2cwsgiutils 6.1.10.dev47__tar.gz → 6.1.10.dev51__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.
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/PKG-INFO +1 -1
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/redis_utils.py +29 -5
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/pyproject.toml +1 -1
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/LICENSE +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/README.md +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/__init__.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/acceptance/__init__.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/acceptance/connection.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/acceptance/image.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/acceptance/package-lock.json +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/acceptance/package.json +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/acceptance/print.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/acceptance/screenshot.js +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/acceptance/utils.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/auth.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/broadcast/__init__.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/broadcast/interface.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/broadcast/local.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/broadcast/redis.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/broadcast/utils.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/client_info.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/config_utils.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/coverage_setup.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/db.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/db_maintenance_view.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/debug/__init__.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/debug/_listeners.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/debug/_views.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/debug/utils.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/errors.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/health_check.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/index.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/loader.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/logging_view.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/models_graph.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/pretty_json.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/profiler.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/prometheus.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/py.typed +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/pyramid.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/pyramid_logging.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/redis_stats.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/request_tracking/__init__.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/request_tracking/_sql.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/scripts/__init__.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/scripts/genversion.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/scripts/stats_db.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/scripts/test_print.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/sentry.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/services.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/setup_process.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/sql_profiler/__init__.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/sql_profiler/_impl.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/sqlalchemylogger/README.md +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/sqlalchemylogger/__init__.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/sqlalchemylogger/_filters.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/sqlalchemylogger/_models.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/sqlalchemylogger/examples/example.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/sqlalchemylogger/handlers.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/static/favicon-16x16.png +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/static/favicon-32x32.png +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/stats_pyramid/__init__.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/stats_pyramid/_db_spy.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/stats_pyramid/_pyramid_spy.py +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/templates/index.html.mako +0 -0
- {c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/version.py +0 -0
|
@@ -18,12 +18,16 @@ _REDIS_OPTIONS_KEY = "C2C_REDIS_OPTIONS"
|
|
|
18
18
|
REDIS_SENTINELS_KEY = "C2C_REDIS_SENTINELS"
|
|
19
19
|
REDIS_SERVICENAME_KEY = "C2C_REDIS_SERVICENAME"
|
|
20
20
|
_REDIS_DB_KEY = "C2C_REDIS_DB"
|
|
21
|
+
_REDIS_PUBSUB_RETRY_DELAY_KEY = "C2C_REDIS_PUBSUB_RETRY_DELAY"
|
|
22
|
+
_REDIS_PUBSUB_GET_MESSAGE_TIMEOUT_KEY = "C2C_REDIS_PUBSUB_GET_MESSAGE_TIMEOUT"
|
|
21
23
|
|
|
22
24
|
REDIS_URL_KEY_PROP = "c2c.redis_url"
|
|
23
25
|
_REDIS_OPTIONS_KEY_PROP = "c2c.redis_options"
|
|
24
26
|
REDIS_SENTINELS_KEY_PROP = "c2c.redis_sentinels"
|
|
25
27
|
REDIS_SERVICENAME_KEY_PROP = "c2c.redis_servicename"
|
|
26
28
|
_REDIS_DB_KEY_PROP = "c2c.redis_db"
|
|
29
|
+
_REDIS_PUBSUB_RETRY_DELAY_KEY_PROP = "c2c.redis_pubsub_retry_delay"
|
|
30
|
+
_REDIS_PUBSUB_GET_MESSAGE_TIMEOUT_KEY_PROP = "c2c.redis_pubsub_get_message_timeout"
|
|
27
31
|
|
|
28
32
|
_master: Optional["redis.client.Redis[str]"] = None
|
|
29
33
|
_slave: Optional["redis.client.Redis[str]"] = None
|
|
@@ -99,10 +103,30 @@ def _init(settings: Optional[Mapping[str, Any]]) -> None:
|
|
|
99
103
|
class PubSubWorkerThread(threading.Thread):
|
|
100
104
|
"""A clone of redis.client.PubSubWorkerThread that doesn't die when the connections are broken."""
|
|
101
105
|
|
|
102
|
-
def __init__(
|
|
106
|
+
def __init__(
|
|
107
|
+
self,
|
|
108
|
+
pubsub: redis.client.PubSub,
|
|
109
|
+
name: str | None = None,
|
|
110
|
+
settings: Mapping[str, Any] | None = None,
|
|
111
|
+
) -> None:
|
|
112
|
+
"""Initialize the PubSubWorkerThread."""
|
|
103
113
|
super().__init__(name=name, daemon=True)
|
|
104
114
|
self.pubsub = pubsub
|
|
105
115
|
self._running = False
|
|
116
|
+
self._retry_delay = c2cwsgiutils.config_utils.env_or_settings(
|
|
117
|
+
settings,
|
|
118
|
+
_REDIS_PUBSUB_RETRY_DELAY_KEY,
|
|
119
|
+
_REDIS_PUBSUB_RETRY_DELAY_KEY_PROP,
|
|
120
|
+
0.5,
|
|
121
|
+
float,
|
|
122
|
+
)
|
|
123
|
+
self._get_message_timeout = c2cwsgiutils.config_utils.env_or_settings(
|
|
124
|
+
settings,
|
|
125
|
+
_REDIS_PUBSUB_GET_MESSAGE_TIMEOUT_KEY,
|
|
126
|
+
_REDIS_PUBSUB_GET_MESSAGE_TIMEOUT_KEY_PROP,
|
|
127
|
+
1.0,
|
|
128
|
+
float,
|
|
129
|
+
)
|
|
106
130
|
|
|
107
131
|
def run(self) -> None:
|
|
108
132
|
if self._running:
|
|
@@ -112,15 +136,15 @@ class PubSubWorkerThread(threading.Thread):
|
|
|
112
136
|
last_was_ok = True
|
|
113
137
|
while pubsub.subscribed:
|
|
114
138
|
try:
|
|
115
|
-
pubsub.get_message(ignore_subscribe_messages=True, timeout=
|
|
139
|
+
pubsub.get_message(ignore_subscribe_messages=True, timeout=self._get_message_timeout)
|
|
116
140
|
if not last_was_ok:
|
|
117
|
-
_LOG.
|
|
141
|
+
_LOG.debug("Redis is back")
|
|
118
142
|
last_was_ok = True
|
|
119
143
|
except redis.exceptions.RedisError:
|
|
120
144
|
if last_was_ok:
|
|
121
|
-
_LOG.
|
|
145
|
+
_LOG.debug("Redis connection problem")
|
|
122
146
|
last_was_ok = False
|
|
123
|
-
time.sleep(
|
|
147
|
+
time.sleep(self._retry_delay)
|
|
124
148
|
except Exception: # pylint: disable=broad-except
|
|
125
149
|
_LOG.warning("Unexpected error", exc_info=True)
|
|
126
150
|
_LOG.info("Redis subscription worker stopped")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/acceptance/connection.py
RENAMED
|
File without changes
|
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/acceptance/package-lock.json
RENAMED
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/acceptance/package.json
RENAMED
|
File without changes
|
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/acceptance/screenshot.js
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/request_tracking/__init__.py
RENAMED
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/request_tracking/_sql.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
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/sql_profiler/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/sqlalchemylogger/README.md
RENAMED
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/sqlalchemylogger/__init__.py
RENAMED
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/sqlalchemylogger/_filters.py
RENAMED
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/sqlalchemylogger/_models.py
RENAMED
|
File without changes
|
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/sqlalchemylogger/handlers.py
RENAMED
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/static/favicon-16x16.png
RENAMED
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/static/favicon-32x32.png
RENAMED
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/stats_pyramid/__init__.py
RENAMED
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/stats_pyramid/_db_spy.py
RENAMED
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/stats_pyramid/_pyramid_spy.py
RENAMED
|
File without changes
|
{c2cwsgiutils-6.1.10.dev47 → c2cwsgiutils-6.1.10.dev51}/c2cwsgiutils/templates/index.html.mako
RENAMED
|
File without changes
|
|
File without changes
|