codosdk 1.0.43__tar.gz → 1.0.45__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.
- {codosdk-1.0.43 → codosdk-1.0.45}/PKG-INFO +1 -1
- {codosdk-1.0.43 → codosdk-1.0.45}/codosdk.egg-info/PKG-INFO +1 -1
- {codosdk-1.0.43 → codosdk-1.0.45}/setup.py +1 -1
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/mqhelper.py +11 -5
- {codosdk-1.0.43 → codosdk-1.0.45}/LICENSE +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/README.md +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/codosdk.egg-info/SOURCES.txt +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/codosdk.egg-info/dependency_links.txt +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/codosdk.egg-info/requires.txt +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/codosdk.egg-info/top_level.txt +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/opssdk/__init__.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/opssdk/utils/__init__.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/pyproject.toml +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/setup.cfg +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/__init__.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/api_set.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/apis/__init__.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/apis/admin_apis.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/apis/agent_apis.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/apis/cmdb_apis.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/apis/kerrigan_apis.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/apis/mgv4_apis.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/apis/notice_apis.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/apis/task_apis.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/application.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/base_handler.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/cache.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/cache_context.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/client.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/cloud/__init__.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/cloud/qcloud_api.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/cloud/ucloud_api.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/cloud_utils.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/configs.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/consts.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/crud_utils.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/db_context.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/error.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/fetch_coroutine.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/jwt_token.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/ldap.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/logger.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/model_utils.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/program.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/salt_api.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/sqlalchemy_pagination.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/tools.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/utils/__init__.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/utils/cc_crypto.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/utils/date_format.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/utils/pydantic_utils.py +0 -0
- {codosdk-1.0.43 → codosdk-1.0.45}/websdk2/web_logs.py +0 -0
|
@@ -9,7 +9,7 @@ desc : CODO SDK
|
|
|
9
9
|
import sys
|
|
10
10
|
from setuptools import setup, find_packages
|
|
11
11
|
|
|
12
|
-
VERSION = '1.0.
|
|
12
|
+
VERSION = '1.0.45'
|
|
13
13
|
|
|
14
14
|
if sys.version_info < (2, 7) or (3, 0) <= sys.version_info < (3, 6):
|
|
15
15
|
print('This program requires at least Python 2.7 or 3.6 to run.')
|
|
@@ -9,6 +9,7 @@ role : rabbitMQ 操作类
|
|
|
9
9
|
import logging
|
|
10
10
|
import traceback
|
|
11
11
|
import pika
|
|
12
|
+
import time
|
|
12
13
|
import threading
|
|
13
14
|
from typing import Optional, List, Dict, Any, Callable
|
|
14
15
|
from .consts import const
|
|
@@ -384,7 +385,8 @@ class MessageQueueBase:
|
|
|
384
385
|
# ==================== 发布消息接口 ====================
|
|
385
386
|
|
|
386
387
|
def publish(self, body: Any, routing_key: Optional[str] = None,
|
|
387
|
-
durable: bool = True, exchange_durable: bool = False
|
|
388
|
+
durable: bool = True, exchange_durable: bool = False,
|
|
389
|
+
queue_durable: bool = None) -> None: # 🔥 新增参数:允许单独控制队列持久性
|
|
388
390
|
"""发布消息"""
|
|
389
391
|
|
|
390
392
|
def _publish_operation():
|
|
@@ -401,7 +403,9 @@ class MessageQueueBase:
|
|
|
401
403
|
|
|
402
404
|
# 如果有队列名,声明并绑定队列
|
|
403
405
|
if self._queue_name:
|
|
404
|
-
|
|
406
|
+
# 🔥 修改:支持单独控制队列持久性,解决队列配置冲突问题
|
|
407
|
+
actual_queue_durable = queue_durable if queue_durable is not None else durable
|
|
408
|
+
channel.queue_declare(queue=self._queue_name, durable=actual_queue_durable)
|
|
405
409
|
channel.queue_bind(
|
|
406
410
|
exchange=self._exchange,
|
|
407
411
|
queue=self._queue_name,
|
|
@@ -442,7 +446,8 @@ class MessageQueueBase:
|
|
|
442
446
|
durable=exchange_durable)
|
|
443
447
|
# 声明队列
|
|
444
448
|
if self._queue_name:
|
|
445
|
-
|
|
449
|
+
# 🔥 修改:消费者也使用默认的非持久化队列设置,避免配置冲突
|
|
450
|
+
result = channel.queue_declare(queue=self._queue_name, durable=False)
|
|
446
451
|
else:
|
|
447
452
|
result = channel.queue_declare('', exclusive=True)
|
|
448
453
|
|
|
@@ -529,9 +534,10 @@ class MessageQueueBase:
|
|
|
529
534
|
RabbitMQConnectionPool._connections[self._mq_key] = None
|
|
530
535
|
|
|
531
536
|
# 统一的向后兼容发布方法
|
|
532
|
-
def publish_message(self, body: Any, durable: bool = True, exchange_durable: bool = False
|
|
537
|
+
def publish_message(self, body: Any, durable: bool = True, exchange_durable: bool = False,
|
|
538
|
+
queue_durable: bool = None) -> None: # 🔥 新增参数:向后兼容方法也支持队列持久性控制
|
|
533
539
|
"""向后兼容的发布方法"""
|
|
534
|
-
self.publish(body, durable=durable, exchange_durable=exchange_durable)
|
|
540
|
+
self.publish(body, durable=durable, exchange_durable=exchange_durable, queue_durable=queue_durable)
|
|
535
541
|
|
|
536
542
|
def close_channel(self) -> None:
|
|
537
543
|
"""关闭连接(向后兼容)"""
|
|
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
|
|
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
|