[patch] 设计PDD的处理消息架构为msg_type 通用模式 处理PDD支持图片类型和 商品卡片类型的消息的发送回复 修改GUI托盘内部样式
This commit is contained in:
@@ -10,6 +10,16 @@ import sys
|
|||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
# 🔥 强制禁用代理,避免代理连接问题
|
||||||
|
# 必须在所有网络操作之前设置
|
||||||
|
os.environ['NO_PROXY'] = '*'
|
||||||
|
os.environ['HTTP_PROXY'] = ''
|
||||||
|
os.environ['HTTPS_PROXY'] = ''
|
||||||
|
os.environ['http_proxy'] = ''
|
||||||
|
os.environ['https_proxy'] = ''
|
||||||
|
os.environ['ALL_PROXY'] = ''
|
||||||
|
os.environ['all_proxy'] = ''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from ks3.connection import Connection
|
from ks3.connection import Connection
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@@ -100,6 +110,7 @@ def upload_installer(connection, installer_path):
|
|||||||
|
|
||||||
# Upload file with public read permission and progress tracking
|
# Upload file with public read permission and progress tracking
|
||||||
# Use cb parameter for progress callback (called every 5% or every 10MB)
|
# Use cb parameter for progress callback (called every 5% or every 10MB)
|
||||||
|
# 🔥 启用分片上传提高大文件上传成功率
|
||||||
key.set_contents_from_filename(
|
key.set_contents_from_filename(
|
||||||
str(installer_path),
|
str(installer_path),
|
||||||
headers={
|
headers={
|
||||||
@@ -111,7 +122,9 @@ def upload_installer(connection, installer_path):
|
|||||||
},
|
},
|
||||||
policy='public-read', # Set ACL policy
|
policy='public-read', # Set ACL policy
|
||||||
cb=progress_callback, # Progress callback function
|
cb=progress_callback, # Progress callback function
|
||||||
num_cb=10 # Call callback 10 times during upload (every 10%)
|
num_cb=10, # Call callback 10 times during upload (every 10%)
|
||||||
|
multipart=True, # 🔥 启用分片上传
|
||||||
|
chunk_size=10485760 # 🔥 10MB每片,提高上传稳定性
|
||||||
)
|
)
|
||||||
|
|
||||||
# Generate download URL (using KS3 third-level domain format)
|
# Generate download URL (using KS3 third-level domain format)
|
||||||
@@ -143,6 +156,8 @@ def main():
|
|||||||
logger.info(f"KS3 Endpoint: {KS3_ENDPOINT}")
|
logger.info(f"KS3 Endpoint: {KS3_ENDPOINT}")
|
||||||
logger.info(f"Bucket: {KS3_BUCKET}")
|
logger.info(f"Bucket: {KS3_BUCKET}")
|
||||||
logger.info(f"Target directory: {KS3_PREFIX}")
|
logger.info(f"Target directory: {KS3_PREFIX}")
|
||||||
|
logger.info("Proxy disabled: Direct connection to KS3")
|
||||||
|
logger.info("Multipart upload: Enabled (10MB chunks)")
|
||||||
logger.info("=" * 70)
|
logger.info("=" * 70)
|
||||||
|
|
||||||
installer_path = find_latest_installer()
|
installer_path = find_latest_installer()
|
||||||
|
|||||||
Reference in New Issue
Block a user