tumblr_draftking 0.8.4 → 0.8.5

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: 5342bd98ea909db6e98c94d631ca8e3a37d95e86
4
- data.tar.gz: 19b5f32880a4f6a1f2aa4949e3b5b77723081d11
3
+ metadata.gz: d6b5f77dda0c0d3fc5e5bf4c4aeaff660dd6f94e
4
+ data.tar.gz: 4b59cd291c87baaaaef3e9d26f1a15a8015b0a71
5
5
  SHA512:
6
- metadata.gz: f2719dbc3d7d3e5e4ee043bc5d38808cc2ba7c59219fe7624a5e5aac7035f33061ec93da3c1bca98622479a0d1fa5c9812b61eb25f883ba3ccf9221048391d4b
7
- data.tar.gz: d2d6ccb11cc72c68453fa881ca0fcbfeeb6679cd0f15a255b003b4b25a357cebc6a6c9611c68b9cb91b0b5d31b7cb9f5c7d77f7ec33be7f9a5b9805ffbeb2b7c
6
+ metadata.gz: 5179163cc06b43b23434a6d823931d3015e2d05a54228a52f7e93865347942b711c2e20bc53b96000ef54dc7c5711b3bd19ca4b07ea75970010726e94c8c7e54
7
+ data.tar.gz: 192a53ce61efd8e3180198530fc1cc8f1dc14869869677b255f13736a86ec82614c4d4eaf6d49cc90a5353a4588148bb7c41c6cb1da5ca058caf487c9124cd96
data/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Changelog :: tumblr_draftking
2
+ ## Version 0.8.5
3
+ + Stability improvement for post retrieval routine
4
+
2
5
  ## Version 0.8.4
3
- + New: CLI now has (-greedy, -g) flags to select on all items in queue before performing action.
6
+ + New: CLI now has (-greedy, -g) flags to select all items in queue before performing action.
4
7
 
5
8
  ## Version 0.8.3.1
6
9
  + Fix: Update @blog_url in DK::Client#process_options to target posts for a blog_name modified after DK::Client creation.
data/README.md CHANGED
@@ -14,8 +14,8 @@ DraftKing for Tumblr takes the hassle out of managing your draft queue!
14
14
  + **Randomize post order to add variety.**
15
15
  + **Manage multiple accounts.**
16
16
 
17
- Version 0.8.4
18
- + New: CLI now has (-greedy, -g) flags to select on all items in queue before performing action.
17
+ Version 0.8.5
18
+ + Stability improvement for post retrieval routine
19
19
 
20
20
  + Please report any [issues] you encounter!
21
21
  + [Change Log](./CHANGELOG.md)
@@ -17,6 +17,7 @@ module DK
17
17
 
18
18
  # Scaling
19
19
  MAX_THREADS = 3
20
+ MAX_RETRY = 2
20
21
 
21
22
  # PostReporter
22
23
  REPORT_TITLE = 'Post Report'.freeze
@@ -135,14 +135,19 @@ module DK
135
135
  # @return [[Post]] Array of Post Hash data
136
136
  def some_posts(before_id: 0, offset: 0, max_id: nil, since_id: nil)
137
137
  options = { limit: [(@limit || 50), 50].min }
138
- options[:max_id] = max_id if max_id
138
+ options[:max_id] = max_id if max_id
139
139
  options[:since_id] = since_id if since_id
140
140
  options[@source == :draft ? :before_id : :offset] =
141
141
  (@source == :draft ? before_id : offset) unless dashboard?
142
142
  options[:type] = @type if @type
143
143
 
144
- result = call_source(options)
145
- result.is_a?(Integer) ? [] : result
144
+ begin
145
+ retries ||= 0
146
+ result = call_source(options)
147
+ result.is_a?(Integer) ? (raise TypeError) : result
148
+ rescue TypeError
149
+ (retries += 1) > MAX_RETRY ? [] : retry
150
+ end
146
151
  end
147
152
 
148
153
  # Dashboard integration
@@ -1,3 +1,3 @@
1
1
  module DK
2
- VERSION = '0.8.4'.freeze
2
+ VERSION = '0.8.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tumblr_draftking
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meissa Dia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-25 00:00:00.000000000 Z
11
+ date: 2017-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tumblr_client