git-fit 0.9.6 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca129e8a18a66ca1cf48deaaffac3c5a7b84b752737bb52e96906a207be7eb19
4
- data.tar.gz: aba8f6fd23d5d6cc89b174b0de160a590dd9a74c20836e4986303e9d2ab5be2b
3
+ metadata.gz: b08e4aac65236128444a75e0890cdaf1e8b25f08a1db325833c7e6c240019b98
4
+ data.tar.gz: b028cc241a518348434988519e5602cbe624d73e80f0b3e5bfbfb0bbe13660ab
5
5
  SHA512:
6
- metadata.gz: 848a12e3fe926fe889c3672d75b0929756ee036622d6c09db8306f6b7590eb63298243d3d90733dcff18b253a285120cf26896546f000f05d7dbe57bc8b28c65
7
- data.tar.gz: bbc19cdda1ceee49217d287cc07073cdbee17ecdf6a41774963670dbf377e2933250ef23a21fdfc9beb75624b86212289b6424408f40409d202c0a0873dc62c7
6
+ metadata.gz: 62d0a2b6b23b44c8d56254fa695fcd5735052319261cb6b146143b88910f704c2eb2df77544bcb23b490409ed271e495d7bade5fff25d6c32e8a9dbb9d717e63
7
+ data.tar.gz: 6ab10823f7a8d558de35ef6eb51d11d7aa88d03a9d61d175623355d5a1f159cfd6a23c7985836b8edf26ce0284e61d99f1506792c1f3017a62852dfbdc493d1c
@@ -32,6 +32,8 @@ module GitFit
32
32
  @shutdown = false
33
33
  @source_start_times = {}
34
34
  @source_activated = {}
35
+ @run_totals = {}
36
+ @run_processed = {}
35
37
  end
36
38
 
37
39
  def run
@@ -128,6 +130,8 @@ module GitFit
128
130
  @adapters.delete(source)
129
131
  @source_start_times.delete(source)
130
132
  @source_activated.delete(source)
133
+ @run_totals.delete(source)
134
+ @run_processed.delete(source)
131
135
  end
132
136
 
133
137
  def worker_loop
@@ -156,13 +160,13 @@ module GitFit
156
160
  end
157
161
 
158
162
  def process_source(source)
159
- @stats_lock.synchronize { @source_start_times[source] ||= Time.now }
160
163
  unless init_source(source)
161
164
  finish_activity(source)
162
165
  return
163
166
  end
167
+ @stats_lock.synchronize { @source_start_times[source] ||= Time.now }
164
168
 
165
- total = @pending_ids[source].size
169
+ total = @run_totals[source] ||= @pending_ids[source].size
166
170
  processed = 0
167
171
  timed_out_local = false
168
172
  auth_failed_local = false
@@ -209,6 +213,8 @@ module GitFit
209
213
  break if processed >= BATCH_SIZE
210
214
  end
211
215
 
216
+ @run_processed[source] = (@run_processed[source] || 0) + processed
217
+
212
218
  if auth_failed_local
213
219
  finish_activity(source, true, 're-auth failed')
214
220
  else
@@ -246,10 +252,11 @@ module GitFit
246
252
  end
247
253
 
248
254
  def report_activity_progress(source, activity, result, processed, total)
255
+ acc = (@run_processed[source] || 0) + processed
249
256
  info = result ? @adapters[source].build_progress_info(result) : nil
250
257
  @output_queue << {
251
258
  type: :progress, source:, id: activity[:id],
252
- info:, done: processed, total:
259
+ info:, done: acc, total:
253
260
  }
254
261
  end
255
262
 
@@ -352,7 +359,7 @@ module GitFit
352
359
  elsif (cnt = info[:done]) && cnt > 0
353
360
  label = "#{cnt} synced"
354
361
  label += ", #{err} errors" if err > 0
355
- label += " (auth failed)" if info[:auth_failed]
362
+ label += ' (auth failed)' if info[:auth_failed]
356
363
  $stdout.puts " done: #{s}: #{label}"
357
364
  elsif info[:auth_failed]
358
365
  $stdout.puts " done: #{s}: 0 synced (auth failed)"
@@ -369,10 +376,9 @@ module GitFit
369
376
  end
370
377
 
371
378
  def show_progress?(done, total)
372
- return true if done.nil? || done <= 3
379
+ return true if done.nil?
373
380
  return true if total && (total - done) <= 5
374
- step = total && total > 0 ? [1, (total / 15.0).ceil].max : 1
375
- step <= 1 || done % step == 0
381
+ done % BATCH_SIZE == 1
376
382
  end
377
383
  end
378
384
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitFit
4
- VERSION = '0.9.6'
4
+ VERSION = '0.9.7'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-fit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lax