Skip to content

storage connect timeout to 30s #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 27, 2025
Merged

storage connect timeout to 30s #25

merged 2 commits into from
Jun 27, 2025

Conversation

YangSen-qn
Copy link
Contributor

No description provided.

VERSION = '1.2.3'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final newline missing (missing-final-newline)

Details

lint 解释

这个lint结果表明在文件的末尾缺少一个换行符(final newline missing)。根据代码风格指南,每个文件应该以一个换行符结束,这样可以确保文件内容不会被其他文本意外地连接在一起。

错误用法

# 这是一个错误的示例,文件末尾没有换行符
def example_function():
    print("Hello, World!")

正确用法

# 这是一个正确的示例,文件末尾有一个换行符
def example_function():
    print("Hello, World!")

# 注意:在最后一行后面有一个空的换行符

💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流

@@ -1,2 +1,2 @@

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing module docstring (missing-module-docstring)

Details

lint 解释

missing-module-docstring 是一个常见的代码质量检查,用于确保每个模块(即 .py 文件)都有一个文档字符串。文档字符串是位于文件顶部的字符串,通常用三引号括起来,用于描述模块的功能和用途。

错误用法

以下是一个缺少模块文档字符串的示例:

# version.py

def get_version():
    return "1.0.0"

在这个例子中,version.py 文件没有包含任何文档字符串。

正确用法

以下是添加了模块文档字符串的正确示例:

"""
This module provides functions to manage and retrieve the version information of the application.
"""

def get_version():
    return "1.0.0"

在这个例子中,version.py 文件顶部包含了一个文档字符串,描述了该模块的功能。


💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流

@@ -15,8 +15,8 @@ class StorageService:
def __init__(self, cfg: config.Config = None):
# Configure boto3 with retries and timeouts
self.s3_config = S3Config(
retries=dict(max_attempts=3, mode="adaptive"),
connect_timeout=5,
retries=dict(max_attempts=2, mode="adaptive"),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using '{"max_attempts": 2, "mode": 'adaptive'}' instead of a call to 'dict'. (use-dict-literal)

Details

lint 解释

这个lint结果提示你使用字面量(literal)来创建一个字典,而不是调用dict函数。这样可以提高代码的可读性和性能。

错误用法

my_dict = dict(max_attempts=2, mode='adaptive')

正确用法

my_dict = {'max_attempts': 2, 'mode': 'adaptive'}

💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流

@YangSen-qn YangSen-qn merged commit 8ff3741 into qiniu:main Jun 27, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant