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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53bda709e38f96e05c5ba1f16b7f788528771a3d54c7305e0e3904a4a342fa93
4
- data.tar.gz: cf29acb97d86b594590e34e98fa7d3fc5863b8e1c3f3a4927d0e859fa1e5d560
3
+ metadata.gz: 74c75707899dc244fea82b758075858a2b70c6fe6834c8e344afd9e5157472ee
4
+ data.tar.gz: f481e091cd4b60f88aae411e38e417a0425d50d39c958ed6d00ded2df0d55b93
5
5
  SHA512:
6
- metadata.gz: 9e78ff07000e38476a6c433e2288893481202860572b173e86b483cd02d03f87e24274a563927f8f69bcab6cea8cfc74f1d466a17093f5d88af407391a2d580d
7
- data.tar.gz: 7cfc5314afcbe1b294c089c230bd6904cdca95f9ddab831d8d77af1d56d16bd226326e292c1b2092586bf1c53ddd8a58cd08122ce618ce20b8a9f4d4bf4922df
6
+ metadata.gz: 20163ffae6234070c536002a995422bf77b47b93abb464e24476665f96875df1a13b64edede1af6a33c8c023a1f42437b0b468ece72e1a0c8793c46a22fda6c5
7
+ data.tar.gz: e3f7ccc9caa2b1e1564fc75acdf0004dff96bcaa04466c7e226473a48893b2bec5f7bd315d696d24de65ce8e9a7f4520282a17aead808362aba7f93714f3a87b
@@ -1,3 +1,7 @@
1
+ ## 0.6.3
2
+
3
+ - Enable chunk (2m each) upload, for imporve the big files upload performance. #35
4
+
1
5
  ## 0.6.2
2
6
 
3
7
  - Fix service_url generate to includes the content-disposition and filename with the `disposition: :inline` mode.
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ActiveStorageAliyun
2
- VERSION = '0.6.2'
2
+ VERSION = '0.6.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activestorage-aliyun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee