sibit 0.20.2 → 0.20.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: 0734db295c639e548f4b51d170e87bbabe2c6b94d7d4ba7e858716b74f145185
4
- data.tar.gz: 9ff51aecc8e78f13917907f62e6485800531dd7d36198df80b5a089831fcbfcc
3
+ metadata.gz: a10cbcbf86d4a0c612ebba219e7e5d0a09480444280a106fd47bb41cbadd0405
4
+ data.tar.gz: 5c3ede973fe824a8f247099c6980b938dc83b07481553bf7925678837553d4ad
5
5
  SHA512:
6
- metadata.gz: '0095805aee3fbe209a73bcda6a9832e9aa26b43414232c6fa59d6fbed09a7648bcd6739e76a558106f86a152a9ebbf5b36c32afffd927f9a2f5feaa34fa4c4d4'
7
- data.tar.gz: 0fde0492c34a1f636180f01d0a331da019e8b461b0819909869cd9f0b5b3f6fb9070f1d79fa6a80f87f3f8903975abeeb7a6e30e9b9b8a4fa5de7f8fbf522794
6
+ metadata.gz: 4bd040eb2e985bd9af773e4bcda1108939cecbcea6b4719f3779eba70a3ce3d2bd69c1deb5c8a748eaaeee85f98fcc6ac5f447189ef635befbd75d68abde6aff
7
+ data.tar.gz: ee1ba5bc4c7bd03d0f975a38c0d2f5d315804eb3444dad26b93511fed19ce3092420907d0a338d4d871dc1abc7fd9307bc3d9f4f7a97a46a6a5824be52c13c62
@@ -33,7 +33,7 @@ class Sibit
33
33
  def client(uri)
34
34
  http = Net::HTTP.new(uri.host, uri.port)
35
35
  http.use_ssl = true
36
- http.read_timeout = 120
36
+ http.read_timeout = 240
37
37
  http
38
38
  end
39
39
  end
@@ -47,7 +47,7 @@ class Sibit
47
47
  def client(uri)
48
48
  http = Net::HTTP.new(uri.host, uri.port, @host, @port.to_i)
49
49
  http.use_ssl = true
50
- http.read_timeout = 120
50
+ http.read_timeout = 240
51
51
  http
52
52
  end
53
53
  end
@@ -62,7 +62,7 @@ class Sibit
62
62
  unless accept.include?(res.code.to_i)
63
63
  raise Sibit::Error, "Failed to retrieve #{uri} (#{res.code}): #{res.body}"
64
64
  end
65
- @log.info("GET #{uri}: #{res.code}/#{res.body.length}b in #{age(start)}")
65
+ @log.info("GET #{uri}: #{res.code}/#{length(res.body.length)} in #{age(start)}")
66
66
  JSON.parse(res.body)
67
67
  end
68
68
 
@@ -91,6 +91,16 @@ class Sibit
91
91
  "#{((Time.now - start) * 1000).round}ms"
92
92
  end
93
93
 
94
+ def length(bytes)
95
+ if bytes > 1024 * 1024
96
+ "#{bytes / (1024 * 1024)}mb"
97
+ elsif bytes > 1024
98
+ "#{bytes / 1024}kb"
99
+ else
100
+ "#{bytes}b"
101
+ end
102
+ end
103
+
94
104
  def user_agent
95
105
  "Anonymous/#{Sibit::VERSION}"
96
106
  end
@@ -26,5 +26,5 @@
26
26
  # License:: MIT
27
27
  class Sibit
28
28
  # Current version of the library.
29
- VERSION = '0.20.2'
29
+ VERSION = '0.20.3'
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sibit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.2
4
+ version: 0.20.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-27 00:00:00.000000000 Z
11
+ date: 2020-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace