gh-archive 0.10 → 0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gh-archive.rb +19 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1a8f0a5088aa3d598466d5ef3ba3472b5e9b0c2ad3327f291c24045c01bdfba
4
- data.tar.gz: b3df61810f7634eb8e9a153a812fa2073078975ee0ca303bfb9fb87e58f08160
3
+ metadata.gz: 652cb53430d2e6a230d8f11465b81685f2e92107868345566d16b07d4c4231ed
4
+ data.tar.gz: abaec255c079e5a959fd51f7b1e7ca15d72c21eaaeac98d34d13309ec91eedeb
5
5
  SHA512:
6
- metadata.gz: f5462029f6ef8e32f632bfdb7552606cf47a924e019502288ee2d841e28e76a5899d944d912a41933834e08e7a813c88cc919a7e93dba42b1c3250fcd911ae6e
7
- data.tar.gz: 1f180c6640e38423ac2cde87ee4181cf04db8bb0a5cc6f861fd39d5de0c5bc4d30df87524f594482c170d591c5cd063abfa539b5715a4850056ab5262acef965
6
+ metadata.gz: 829b1d53a7b72f4ea83712e8a95ba059e48dff7c982e811d30d27018e45e1b7010ace2a4a3f2641318a598e765a6d2c6138b319f9d67dd2604617dc2785175be
7
+ data.tar.gz: fd85da1c6630e8b534fb34fc9b5a08fcda55e3d2606ca393157134b6d85da2a9a7f92bc87ae31369441da1799cfd2178f0af9703ca997d10296c3f9a5ab1e4f9
data/lib/gh-archive.rb CHANGED
@@ -137,6 +137,9 @@ class GHAProvider
137
137
 
138
138
  self.each_time(from, to) do |current_time|
139
139
  events = []
140
+
141
+ update_checkpoint(current_time)
142
+
140
143
  begin
141
144
  events = self.get(current_time)
142
145
  rescue GHAException => e
@@ -148,8 +151,6 @@ class GHAProvider
148
151
  next
149
152
  end
150
153
 
151
- update_checkpoint(current_time)
152
-
153
154
  events.each do |event|
154
155
  skip = false
155
156
  @includes.each do |key, value|
@@ -187,13 +188,25 @@ class OnlineGHAProvider < GHAProvider
187
188
  def initialize(max_retries = 3, proactive = false, proactive_pool_size = 10)
188
189
  super()
189
190
 
190
- @max_retries = max_retries
191
- @proactive = proactive
192
- @proactive_pool_size = proactive_pool_size
193
- @pool = Thread.pool(proactive_pool_size)
191
+ self.max_retries(max_retries)
192
+ self.proactive(proactive_pool_size) if proactive
193
+
194
194
  @cache = Cache.new
195
195
  end
196
196
 
197
+ def max_retries(n)
198
+ @max_retries = n
199
+
200
+ return self
201
+ end
202
+
203
+ def proactive(pool_size = 10)
204
+ @proactive = true
205
+ @pool = Thread.pool(pool_size)
206
+
207
+ return self
208
+ end
209
+
197
210
  def get(current_time)
198
211
  @max_retries.times do
199
212
  begin
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gh-archive
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.10'
4
+ version: '0.11'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simone Scalabrino