-
Notifications
You must be signed in to change notification settings - Fork 263
新版分片上传 #391
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
新版分片上传 #391
Conversation
5542676
to
e112a2e
Compare
.idea/.gitignore
Outdated
/dataSources/ | ||
/dataSources.local.xml | ||
# Editor-based HTTP Client requests | ||
/httpRequests/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@okbang9 .idea 目录不要提交
test_qiniu.py
Outdated
ret, info = put_stream(token, key, input_stream, os.path.basename(__file__), size, hostscache_dir, | ||
self.params, | ||
self.mime_type, part_size=1024 * 1024 * 10, version='v2', bucket_name=bucket_name) | ||
print("\n\n\n\n\n", info) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@okbang9 不要加这么多回车。。
Codecov Report
@@ Coverage Diff @@
## master #391 +/- ##
==========================================
+ Coverage 66.22% 67.78% +1.56%
==========================================
Files 20 20
Lines 1723 1847 +124
==========================================
+ Hits 1141 1252 +111
- Misses 582 595 +13
Continue to review full report at Codecov.
|
qiniu/services/storage/uploader.py
Outdated
return record['offset'] | ||
|
||
def upload(self): | ||
def upload(self, metadata=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@okbang9 这个 metadata
先不要罢,v1 其实也有这个参数,但是这个 sdk 也没支持,所以先去掉。
venv/pyvenv.cfg
Outdated
@@ -0,0 +1,3 @@ | |||
home = /usr/local/bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@okbang9 这个目录不应该提交的
qiniu/services/storage/uploader.py
Outdated
if ret is None or crc != ret['crc32']: | ||
return ret, info | ||
if self.version == 'v1': | ||
if info.need_retry(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@okbang9 v1
的 crc32 验证不能去掉啊
qiniu/services/storage/uploader.py
Outdated
def block_url(self, host, size): | ||
return '{0}/mkblk/{1}'.format(host, size) | ||
|
||
def block_url_v2(self, host, bucket_name): | ||
encode_object_name = urlsafe_base64_encode(self.key) if self.key is not None else '~' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@okbang9 encode_object_name
=> encoded_object_name
No description provided.