Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
download
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
download
Commits
cd7b9ce2
Commit
cd7b9ce2
authored
Oct 28, 2022
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
c626d9ab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
download.py
download.py
+7
-2
No files found.
download.py
View file @
cd7b9ce2
...
...
@@ -84,7 +84,9 @@ class DownFile:
self
.
local
.
count_sleep
=
0
for
item
in
data
:
if
self
.
local
.
count_sleep
>=
50
:
self
.
lock
.
acquire
()
self
.
log
(
'sleep'
,
'-----10s-----'
)
self
.
lock
.
release
()
time
.
sleep
(
10
)
self
.
local
.
count_sleep
=
0
...
...
@@ -105,7 +107,9 @@ class DownFile:
self
.
local
.
url
=
self
.
ali_yun_sdk
(
item
[
'call_time'
],
item
[
'call_id'
])
self
.
local
.
is_ok
=
0
except
Exception
as
result
:
self
.
lock
.
acquire
()
self
.
log
(
"exception 20s------------"
,
str
(
result
))
self
.
lock
.
release
()
time
.
sleep
(
20
)
self
.
local
.
is_ok
=
1
...
...
@@ -115,9 +119,11 @@ class DownFile:
self
.
local
.
count_sleep
=
self
.
local
.
count_sleep
+
1
# 增加暂停计数
self
.
local
.
url
=
self
.
ali_yun_sdk
(
item
[
'call_time'
],
item
[
'call_id'
])
except
Exception
as
result
:
self
.
lock
.
acquire
()
self
.
log
(
"two exception error-----call_time="
+
item
[
'call_time'
]
+
'&call_id='
+
item
[
'call_id'
],
str
(
result
))
self
.
lock
.
release
()
if
len
(
self
.
local
.
url
)
==
0
:
continue
...
...
@@ -152,12 +158,11 @@ class DownFile:
self
.
lock
.
acquire
()
self
.
download_num
=
self
.
download_num
+
1
self
.
lock
.
release
()
self
.
log
(
'url'
,
self
.
local
.
url
)
self
.
log
(
'download_file'
,
self
.
local
.
result
)
self
.
log
(
"download_num"
,
self
.
download_num
)
self
.
log
(
"old_num"
,
self
.
old_num
)
self
.
lock
.
release
()
def
download_remote
(
self
,
data
):
"""
...
...
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