activestorage-aliyun 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/active_storage/service/aliyun_service.rb +3 -1
- data/lib/active_storage_aliyun/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74c75707899dc244fea82b758075858a2b70c6fe6834c8e344afd9e5157472ee
|
4
|
+
data.tar.gz: f481e091cd4b60f88aae411e38e417a0425d50d39c958ed6d00ded2df0d55b93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20163ffae6234070c536002a995422bf77b47b93abb464e24476665f96875df1a13b64edede1af6a33c8c023a1f42437b0b468ece72e1a0c8793c46a22fda6c5
|
7
|
+
data.tar.gz: e3f7ccc9caa2b1e1564fc75acdf0004dff96bcaa04466c7e226473a48893b2bec5f7bd315d696d24de65ce8e9a7f4520282a17aead808362aba7f93714f3a87b
|
data/CHANGELOG.md
CHANGED
@@ -8,11 +8,13 @@ module ActiveStorage
|
|
8
8
|
@config = config
|
9
9
|
end
|
10
10
|
|
11
|
+
CHUNK_SIZE = 1024 * 1024
|
12
|
+
|
11
13
|
def upload(key, io, checksum: nil, content_type: nil, disposition: nil, filename: nil)
|
12
14
|
instrument :upload, key: key, checksum: checksum do
|
13
15
|
content_type ||= Marcel::MimeType.for(io)
|
14
16
|
bucket.put_object(path_for(key), content_type: content_type) do |stream|
|
15
|
-
stream << io.read
|
17
|
+
stream << io.read(CHUNK_SIZE) until io.eof?
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|