heroku_pg_backups_archive 0.2.0 → 0.2.1
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 +4 -4
- data/lib/heroku_pg_backups_archive.rb +1 -1
- data/lib/heroku_pg_backups_archive/backup.rb +1 -3
- data/lib/heroku_pg_backups_archive/operation_failed_error.rb +4 -0
- data/lib/heroku_pg_backups_archive/toolbelt_helper.rb +19 -3
- data/lib/heroku_pg_backups_archive/version.rb +1 -1
- metadata +2 -2
- data/lib/heroku_pg_backups_archive/backup_failed_error.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85c8b0805d3fff81c92d1c13d66f52d9fad14a8e
|
4
|
+
data.tar.gz: d729910cf6a3d6ee98a66416df7ee1b0bf3f2464
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 478c54c48298ca0be41b2146c17f1fe18bd50edb9a175bb26a3ff5154e1c423b633f38ecb0b24a488a7406b637ccf75034d51eda1cde2fd3d761a7b0576e310e
|
7
|
+
data.tar.gz: e4740766f316823196d2589ccec7a0e6680db6b0a0f44157f7dea3866714e25e25f814651e8ce695b6a897c30c35ec85f76795aa186bf89a34108cc5d0ef357b
|
@@ -2,7 +2,7 @@ require "heroku_pg_backups_archive/version"
|
|
2
2
|
require "heroku_pg_backups_archive/config"
|
3
3
|
require "heroku_pg_backups_archive/backup"
|
4
4
|
require "heroku_pg_backups_archive/backup_archive"
|
5
|
-
require "heroku_pg_backups_archive/
|
5
|
+
require "heroku_pg_backups_archive/operation_failed_error"
|
6
6
|
require "heroku_pg_backups_archive/toolbelt_helper"
|
7
7
|
require "heroku_pg_backups_archive/railtie"
|
8
8
|
|
@@ -25,9 +25,7 @@ module HerokuPgBackupsArchive
|
|
25
25
|
private
|
26
26
|
|
27
27
|
def extract_id(backup_output)
|
28
|
-
|
29
|
-
raise BackupFailedError.new(backup_output) unless matches
|
30
|
-
matches[1]
|
28
|
+
backup_output.match(/---backup---> (.*)\n/)[1]
|
31
29
|
end
|
32
30
|
end
|
33
31
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module HerokuPgBackupsArchive
|
2
2
|
module ToolbeltHelper
|
3
|
+
RETRIES = 5
|
4
|
+
|
3
5
|
class << self
|
4
6
|
def capture_backup
|
5
7
|
run("pg:backups capture -a #{HerokuPgBackupsArchive.config.app_name}")
|
@@ -18,9 +20,23 @@ module HerokuPgBackupsArchive
|
|
18
20
|
def run(arguments)
|
19
21
|
command = "#{HerokuPgBackupsArchive.config.heroku_toolbelt_path} #{arguments}"
|
20
22
|
puts "Running: #{command}"
|
21
|
-
|
22
|
-
|
23
|
-
|
23
|
+
|
24
|
+
retries_remaining = RETRIES
|
25
|
+
begin
|
26
|
+
output = `#{command} 2>&1`
|
27
|
+
raise OperationFailedError.new(output) unless $?.success?
|
28
|
+
puts "Output:\n#{output}"
|
29
|
+
return output
|
30
|
+
rescue OperationFailedError => ex
|
31
|
+
retries_remaining -= 1
|
32
|
+
if retries_remaining > 0
|
33
|
+
puts "Failed, retrying..."
|
34
|
+
retry
|
35
|
+
else
|
36
|
+
puts "Still failing after #{RETRIES} retries, giving up."
|
37
|
+
raise ex
|
38
|
+
end
|
39
|
+
end
|
24
40
|
end
|
25
41
|
end
|
26
42
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroku_pg_backups_archive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hightower
|
@@ -88,8 +88,8 @@ files:
|
|
88
88
|
- lib/heroku_pg_backups_archive.rb
|
89
89
|
- lib/heroku_pg_backups_archive/backup.rb
|
90
90
|
- lib/heroku_pg_backups_archive/backup_archive.rb
|
91
|
-
- lib/heroku_pg_backups_archive/backup_failed_error.rb
|
92
91
|
- lib/heroku_pg_backups_archive/config.rb
|
92
|
+
- lib/heroku_pg_backups_archive/operation_failed_error.rb
|
93
93
|
- lib/heroku_pg_backups_archive/railtie.rb
|
94
94
|
- lib/heroku_pg_backups_archive/toolbelt_helper.rb
|
95
95
|
- lib/heroku_pg_backups_archive/version.rb
|