wework 0.2.6 → 0.2.7

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
  SHA1:
3
- metadata.gz: f6ee37102d3877e1fe4208f3bf1125febeb4c5f1
4
- data.tar.gz: 657524866686143b2a1d1c6adc97b7c9aa366fe2
3
+ metadata.gz: 73b9f44413eff7e54924569e7c769db0529aaec6
4
+ data.tar.gz: da37a68c10c5fe703e15d6634fd3cd71c659d93f
5
5
  SHA512:
6
- metadata.gz: 295b787230ca11c0bfd8e533f305db84b523131ca8fc878e5fa1f1b7bbad300dcb7c050baba458ff890948d1806006aead9a6dfa619862da1aeffc892aea4a69
7
- data.tar.gz: 3a9206d6548cba4fae41b2770368dcb299d9183dc55223acb9cbb3c523a5f43b5933779f289a127896a793566dab54888318c9482e475e259b9f8254efb883f1
6
+ metadata.gz: 4a6b77220dcd8c57a8868f2ed0d473786f95229e5becf77724bf37e4fb0e4ce6b3888009e59772f92f1d69681a1652f5535b6feeaec63368d0d8da8ad3e4b90d
7
+ data.tar.gz: 88955aaab3ee265877a583b4680ac946b9dc4a5482d99fc3f300c2a22333c42d7f48558279e5275e44a989a5be8d779278e691687bad24fcb6781e705974335d
data/lib/wework/config.rb CHANGED
@@ -17,9 +17,13 @@ module Wework
17
17
  def http_timeout_options
18
18
  config.http_timeout_options || {write: 2, connect: 5, read: 10}
19
19
  end
20
+
21
+ def expired_shift_seconds
22
+ config.expired_shift_seconds || 100
23
+ end
20
24
  end
21
25
 
22
26
  class Config
23
- attr_accessor :redis, :http_timeout_options
27
+ attr_accessor :redis, :http_timeout_options, :expired_shift_seconds
24
28
  end
25
29
  end
@@ -19,7 +19,7 @@ module Wework
19
19
  def refresh_token
20
20
  result = super
21
21
  if result.success?
22
- expires_at = Time.now.to_i + result.expires_in.to_i - 100
22
+ expires_at = Time.now.to_i + result.expires_in.to_i - Wework.expired_shift_seconds
23
23
  redis.hmset(
24
24
  key,
25
25
  "ticket", result.ticket,
@@ -19,7 +19,7 @@ module Wework
19
19
  def refresh_token
20
20
  result = super
21
21
  if result.success?
22
- expires_at = Time.now.to_i + result.expires_in.to_i - 100
22
+ expires_at = Time.now.to_i + result.expires_in.to_i - Wework.expired_shift_seconds
23
23
  redis.hmset(
24
24
  key,
25
25
  "access_token", result.access_token,
@@ -1,3 +1,3 @@
1
1
  module Wework
2
- VERSION = '0.2.6'.freeze
2
+ VERSION = '0.2.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - seandong
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-07 00:00:00.000000000 Z
11
+ date: 2017-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http