tapsoob 0.5.27-java → 0.5.28-java

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: 64913bf573488ae2289aa0f84f33b09430b64e7556df3829c5d96cfea40bbb1d
4
- data.tar.gz: 50e3ddb402f4775b791553f1c804368cf42e1c0ebb0925240a92f116a2bbca4e
3
+ metadata.gz: 7554a38a7588261f53f4d653a513c7befc0fe900bd4ca2e12707623f3e574d82
4
+ data.tar.gz: df55e85a95cba4f95c30a9eeabd3d7523949ff492422159d997a6d848bb1c39f
5
5
  SHA512:
6
- metadata.gz: f2c54e67813d6c1209b884e67bbfde35a1940c5ccbb82f53f4371742d0d63baa898e3f888ed94b2f7feba5428e6db3d4e5f12ac0c17ba54413e09484ffc3b82a
7
- data.tar.gz: f7e820052a312fc0d81e9e146a204ed9454a724ddb642cc2c24c4100588e1825dce59e1f34585e2f5d629dad6f8a5d08180b8b2e074cd171c4b4519609f5e5d9
6
+ metadata.gz: 804658b12d9d1f43fbc80670645854ccaa54e3cc915e754e3433efa61738a646d73afa2ddf28fee2f317ffc3e8d269778a9533e31aa9bc7cf2b7cfb8f1d04ffc
7
+ data.tar.gz: ac1ff9b60b5b52fcadd568b772337a8257b814fa23cc2d6b035fabf5d2c99de320ea1054e45fae4c955ec1a2de2de1ff3a34f9eba947b4fbfaeb721b9d01f3f8
@@ -202,7 +202,7 @@ module Tapsoob
202
202
  :chunksize => default_chunksize,
203
203
  :table_name => table_name
204
204
  }, { :debug => opts[:debug] })
205
- estimated_chunks = (count.to_f / default_chunksize).ceil
205
+ estimated_chunks = [(count.to_f / default_chunksize).ceil, 1].max
206
206
  progress = (opts[:progress] ? ProgressBar.new(table_name.to_s, estimated_chunks) : nil)
207
207
  pull_data_from_table(stream, progress)
208
208
  end
@@ -217,7 +217,7 @@ module Tapsoob
217
217
 
218
218
  stream = Tapsoob::DataStream.factory(db, stream_state)
219
219
  chunksize = stream_state[:chunksize] || default_chunksize
220
- estimated_chunks = (record_count.to_f / chunksize).ceil
220
+ estimated_chunks = [(record_count.to_f / chunksize).ceil, 1].max
221
221
  progress = (opts[:progress] ? ProgressBar.new(table_name.to_s, estimated_chunks) : nil)
222
222
  pull_data_from_table(stream, progress)
223
223
  end
@@ -423,8 +423,10 @@ module Tapsoob
423
423
  table_name = stream_state[:table_name]
424
424
  record_count = tables[table_name.to_s]
425
425
  log.info "Resuming #{table_name}, #{format_number(record_count)} records"
426
- progress = ProgressBar.new(table_name.to_s, record_count)
427
426
  stream = Tapsoob::DataStream.factory(db, stream_state)
427
+ chunksize = stream_state[:chunksize] || default_chunksize
428
+ estimated_chunks = [(record_count.to_f / chunksize).ceil, 1].max
429
+ progress = (opts[:progress] ? ProgressBar.new(table_name.to_s, estimated_chunks) : nil)
428
430
  push_data_from_file(stream, progress)
429
431
  end
430
432
 
@@ -445,7 +447,8 @@ module Tapsoob
445
447
  :purge => opts[:purge] || false,
446
448
  :debug => opts[:debug]
447
449
  })
448
- progress = (opts[:progress] ? ProgressBar.new(table_name.to_s, count) : nil)
450
+ estimated_chunks = [(count.to_f / default_chunksize).ceil, 1].max
451
+ progress = (opts[:progress] ? ProgressBar.new(table_name.to_s, estimated_chunks) : nil)
449
452
  push_data_from_file(stream, progress)
450
453
  end
451
454
  end
@@ -496,7 +499,8 @@ module Tapsoob
496
499
  end
497
500
  stream.state[:chunksize] = chunksize
498
501
 
499
- progress.inc(row_size) if progress
502
+ # Update progress bar by 1 chunk
503
+ progress.inc(1) if progress
500
504
 
501
505
  break if stream.complete?
502
506
  end
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Tapsoob
3
- VERSION = "0.5.27".freeze
3
+ VERSION = "0.5.28".freeze
4
4
  end
@@ -2,7 +2,7 @@ namespace :tapsoob do
2
2
  desc "Pulls a database to your filesystem"
3
3
  task :pull => :environment do
4
4
  # Default options
5
- opts={:default_chunksize => 1000, :debug => false, :resume_filename => nil, :disable_compression => false, :schema => true, :data => true, :indexes_first => false}
5
+ opts={:default_chunksize => 1000, :debug => false, :resume_filename => nil, :disable_compression => false, :schema => true, :data => true, :indexes_first => false, :progress => true}
6
6
 
7
7
  # Get the dump_path
8
8
  dump_path = File.expand_path(Rails.root.join("db", Time.now.strftime("%Y%m%d%I%M%S%p"))).to_s
@@ -23,7 +23,7 @@ namespace :tapsoob do
23
23
  desc "Push a compatible dump on your filesystem to a database"
24
24
  task :push, [:timestamp] => :environment do |t, args|
25
25
  # Default options
26
- opts={:default_chunksize => 1000, :debug => false, :resume_filename => nil, :disable_compression => false, :schema => true, :data => true, :indexes_first => false}
26
+ opts={:default_chunksize => 1000, :debug => false, :resume_filename => nil, :disable_compression => false, :schema => true, :data => true, :indexes_first => false, :progress => true}
27
27
 
28
28
  # Get the dumps
29
29
  dumps = Dir[Rails.root.join("db", "*/")].select { |e| e =~ /([0-9]{14})([A-Z]{2})/ }.sort
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tapsoob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.27
4
+ version: 0.5.28
5
5
  platform: java
6
6
  authors:
7
7
  - Félix Bellanger