Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
doudian-py
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiquan
doudian-py
Commits
e00f6687
Commit
e00f6687
authored
Aug 08, 2025
by
baiquan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(shop): 调整线程池参数和上传逻辑
- 将线程池参数设置移至特定任务类型下 - 暂时注释掉视频上传中的异常处理逻辑
parent
fc37c9b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
service/upload_video.py
+8
-8
shop.py
+4
-4
No files found.
service/upload_video.py
View file @
e00f6687
...
...
@@ -633,14 +633,14 @@ def is_video_corrupted(file_path):
def
upload_video_with_multithreading
(
task
):
"""多线程视频上传主函数"""
# 准备视频文件(同原逻辑)
try
:
file_path
=
prepare_video_file
(
task
)
except
VideoError
:
# 视频时长超过60秒, 使用生成视频
video_info
=
generate_video
(
task
)
return
video_info
except
Exception
as
e
:
raise
e
#
try:
file_path
=
prepare_video_file
(
task
)
#
except VideoError:
#
# 视频时长超过60秒, 使用生成视频
#
video_info = generate_video(task)
#
return video_info
#
except Exception as e:
#
raise e
# 初始化上传
upload
=
Upload
(
task
)
upload
.
file_size
=
os
.
path
.
getsize
(
file_path
)
...
...
shop.py
View file @
e00f6687
...
...
@@ -227,10 +227,6 @@ async def run(task_type):
if
__name__
==
'__main__'
:
# 外层线程池大小
OUTER_MAX_WORKERS
=
5
# 内层线程池大小(每个任务)
INNER_MAX_WORKERS
=
3
argv
=
sys
.
argv
try
:
if
len
(
argv
)
!=
2
:
...
...
@@ -250,6 +246,10 @@ if __name__ == '__main__':
INNER_MAX_WORKERS
=
1
time
.
sleep
(
10
)
elif
task_type
==
TaskType
.
DOUDIAN_UPLOAD_IMAGE_AND_VIDEO
:
# 外层线程池大小
OUTER_MAX_WORKERS
=
5
# 内层线程池大小(每个任务)
INNER_MAX_WORKERS
=
3
time
.
sleep
(
1
)
else
:
time
.
sleep
(
5
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment