sycommon-python-lib 0.1.51__tar.gz → 0.1.52__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.
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/PKG-INFO +1 -1
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/pyproject.toml +1 -1
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/rabbitmq/rabbitmq_client.py +17 -10
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon_python_lib.egg-info/PKG-INFO +1 -1
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/README.md +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/setup.cfg +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/command/cli.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/__init__.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/config/Config.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/config/DatabaseConfig.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/config/EmbeddingConfig.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/config/LLMConfig.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/config/MQConfig.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/config/RerankerConfig.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/config/__init__.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/database/base_db_service.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/database/database_service.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/health/__init__.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/health/health_check.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/health/metrics.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/health/ping.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/logging/__init__.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/logging/kafka_log.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/logging/logger_wrapper.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/logging/sql_logger.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/__init__.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/context.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/cors.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/docs.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/exception.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/middleware.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/monitor_memory.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/mq.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/timeout.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/traceid.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/models/__init__.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/models/base_http.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/models/log.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/models/mqlistener_config.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/models/mqmsg_model.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/models/mqsend_config.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/models/sso_user.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/rabbitmq/rabbitmq_pool.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/rabbitmq/rabbitmq_service.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/services.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/sse/__init__.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/sse/event.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/sse/sse.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/synacos/__init__.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/synacos/example.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/synacos/example2.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/synacos/feign.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/synacos/feign_client.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/synacos/nacos_service.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/synacos/param.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/tools/__init__.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/tools/docs.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/tools/snowflake.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/tools/timing.py +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon_python_lib.egg-info/SOURCES.txt +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon_python_lib.egg-info/dependency_links.txt +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon_python_lib.egg-info/entry_points.txt +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon_python_lib.egg-info/requires.txt +0 -0
- {sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon_python_lib.egg-info/top_level.txt +0 -0
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/rabbitmq/rabbitmq_client.py
RENAMED
|
@@ -307,22 +307,29 @@ class RabbitMQClient:
|
|
|
307
307
|
return self._consumer_tag
|
|
308
308
|
|
|
309
309
|
async def stop_consuming(self) -> None:
|
|
310
|
-
"""
|
|
310
|
+
"""停止消息消费(适配 RobustChannel)"""
|
|
311
311
|
async with self._consume_lock:
|
|
312
312
|
try:
|
|
313
|
-
#
|
|
313
|
+
# 校验核心条件:消费标签、队列、通道均有效
|
|
314
314
|
if self._consumer_tag and self._queue and self._channel and not self._channel.is_closed:
|
|
315
|
-
#
|
|
316
|
-
await self.
|
|
315
|
+
# 使用队列的 cancel 方法(适配 RobustChannel)
|
|
316
|
+
await self._queue.cancel(self._consumer_tag)
|
|
317
317
|
logger.info(
|
|
318
|
-
f"停止消费成功,consumer_tag: {self._consumer_tag},队列: {self._queue.name}"
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
318
|
+
f"停止消费成功,consumer_tag: {self._consumer_tag},队列: {self._queue.name}"
|
|
319
|
+
)
|
|
320
|
+
elif self._consumer_tag:
|
|
321
|
+
# 部分资源无效时的日志提示
|
|
322
|
+
if not self._queue:
|
|
323
|
+
logger.warning(
|
|
324
|
+
f"消费标签存在但队列为空,无法取消消费(consumer_tag: {self._consumer_tag})")
|
|
325
|
+
elif not self._channel or self._channel.is_closed:
|
|
326
|
+
logger.warning(
|
|
327
|
+
f"通道已关闭,消费已自动停止(consumer_tag: {self._consumer_tag},队列: {self._queue.name if self._queue else '未知'})"
|
|
328
|
+
)
|
|
323
329
|
except Exception as e:
|
|
324
330
|
logger.error(
|
|
325
|
-
f"停止消费者 '{self._queue.name if self._queue else '未知队列'}' 时出错: {str(e)}", exc_info=True
|
|
331
|
+
f"停止消费者 '{self._queue.name if self._queue else '未知队列'}' 时出错: {str(e)}", exc_info=True
|
|
332
|
+
)
|
|
326
333
|
finally:
|
|
327
334
|
self._consumer_tag = None # 无论成败,清理消费标签
|
|
328
335
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/config/DatabaseConfig.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/config/EmbeddingConfig.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/config/RerankerConfig.py
RENAMED
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/database/base_db_service.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/database/database_service.py
RENAMED
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/health/health_check.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/logging/logger_wrapper.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/logging/sql_logger.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/__init__.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/context.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/exception.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/middleware.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/monitor_memory.py
RENAMED
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/timeout.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/middleware/traceid.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/models/mqlistener_config.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/models/mqmsg_model.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/models/mqsend_config.py
RENAMED
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/rabbitmq/rabbitmq_pool.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/rabbitmq/rabbitmq_service.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
|
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/synacos/feign_client.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.51 → sycommon_python_lib-0.1.52}/src/sycommon/synacos/nacos_service.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|