Commit 1d0032e0 authored by 张永's avatar 张永

Merge branch 'feature/channel_package_zy' into 'test'

处理下载失败

See merge request alpha/sun!91
parents 3080ed7b 7d5ef85b
......@@ -34,8 +34,14 @@ def version_release_task(packed_channels, version_id=None, version=None): # 一
@shared_task
def channel_build_one(version=None, channel=None, data=None):
url = ChannelPackage.apk_url('', version)
r = requests.get(url, stream=True)
info_logger.debug(url)
for _ in range(5):
try:
r = requests.get(url, stream=True)
info_logger.debug(url)
if r.content:
break
except:
info_logger.debug('第%s下载失败%s:', _, url)
chn_pkg = ChannelPackage(r.content, version)
build_one_channel(chn_pkg, channel)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment