stellar-core-backup 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: 6155ceecee6b25c41b2489c31f68781f194eb610
4
- data.tar.gz: b3a29645d58230e00a817c3a80152d193e597295
3
+ metadata.gz: 036788c4ca590787bf980fb86d5a766f8ffc0cff
4
+ data.tar.gz: 2912860cd046d4fb50cae3572b9af9b5c8668da3
5
5
  SHA512:
6
- metadata.gz: 86ea0707f78f3e6002d93cfecf50781c6cd8688861b14fbddff685d531c28f14a46e81b6164468f3cdc1f551c5962f5c28e03f872b603b743fe1fe49807edcef
7
- data.tar.gz: 0070acbe82d29852503aad3d990e58572d6cdab4368da34a6f7585188d47d2ab4117ac8ffc6f4d450148174fa3ed79c913c9988bace047a2d873e48057a195b2
6
+ metadata.gz: d0225b353f3638ea8ba37de50e37e00ac710aff9541384f8bbf881b30bb260e3fa1007f90ebd9b3e18816ca3498b399882a3c83603b40f8782954be8dfcee581
7
+ data.tar.gz: 3cca8e3f4456cfc256e99951b612933bd0d572dc0756f14a75c66b58b6bbbf740d1e2657e2bd71ddd19940665b21f3f5ae9c2b4f2ec532ae38c2b971806dc979
@@ -23,7 +23,7 @@ module StellarCoreBackup
23
23
  def pg_dump()
24
24
  cmd = StellarCoreBackup::Cmd.new(@working_dir)
25
25
  puts "info: connecting (#{get_db_details(@config.get('core_config')).gsub(/password=(.*)/, 'password=********')})"
26
- pg_dump = cmd.run('pg_dump', ['--dbname', @dbname, '--format', 'd', '--file', "#{@working_dir}/core-db/"])
26
+ pg_dump = cmd.run('pg_dump', ['--dbname', @dbname, '--format', 'd', '--jobs', "#{StellarCoreBackup::Utils.num_cores?()}", '--file', "#{@working_dir}/core-db/"])
27
27
  if pg_dump.success then
28
28
  puts "info: database backup complete"
29
29
  end
@@ -24,7 +24,7 @@ module StellarCoreBackup::Restore
24
24
  Contract nil => Bool
25
25
  def pg_restore()
26
26
  # we are restoring to public schema
27
- pg_restore = @cmd.run('pg_restore', ['-n', 'public', '-c', '-d', @dbname, 'core-db/'])
27
+ pg_restore = @cmd.run('pg_restore', ['-n', 'public', '--jobs', "#{StellarCoreBackup::Utils.num_cores?()}", '-c', '-d', @dbname, 'core-db/'])
28
28
  if pg_restore.success then
29
29
  return true
30
30
  else
@@ -126,5 +126,12 @@ module StellarCoreBackup
126
126
  end
127
127
  end
128
128
 
129
+ # return number of available cores
130
+ Contract nil => Integer
131
+ def self.num_cores?()
132
+ require 'etc'
133
+ return Etc.nprocessors
134
+ end
135
+
129
136
  end
130
137
  end
@@ -1,3 +1,3 @@
1
1
  module StellarCoreBackup
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stellar-core-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Llewellyn-Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-01 00:00:00.000000000 Z
11
+ date: 2019-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: contracts