Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in
Toggle navigation
Menu
Open sidebar
gitlab-qa-sandbox-group
qa-test-2019-05-06-03-38-42-40f225278db2df81
add-member-project-38ac0d05ff9a6e41
Commits
237571e8
Commit
237571e8
authored
Sep 18, 2015
by
Jacob Vosmaer
Browse files
Use faster gzip compression during backup
parent
b9bbad52
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/backup/database.rb
View file @
237571e8
...
...
@@ -21,7 +21,7 @@ module Backup
def
dump
(
mysql_to_postgresql
=
false
)
FileUtils
.
rm_f
(
db_file_name
)
compress_rd
,
compress_wr
=
IO
.
pipe
compress_pid
=
spawn
(
*
%W(gzip -c)
,
in:
compress_rd
,
out:
[
db_file_name
,
'w'
,
0600
])
compress_pid
=
spawn
(
*
%W(gzip
-1
-c)
,
in:
compress_rd
,
out:
[
db_file_name
,
'w'
,
0600
])
compress_rd
.
close
dump_pid
=
case
config
[
"adapter"
]
...
...
@@ -55,7 +55,7 @@ module Backup
statuses
=
Open3
.
pipeline
(
%W(gzip -cd
#{
mysql_dump_gz
}
)
,
%W(python lib/support/mysql-postgresql-converter/db_converter.py - -
#{
drop_indexes_sql
}
)
,
%W(gzip -c)
,
%W(gzip
-1
-c)
,
out:
[
psql_dump_gz
,
'w'
,
0600
]
)
...
...
@@ -67,7 +67,7 @@ module Backup
$progress
.
print
"Splicing in 'DROP INDEX' statements ... "
statuses
=
Open3
.
pipeline
(
%W(lib/support/mysql-postgresql-converter/splice_drop_indexes
#{
psql_dump_gz
}
#{
drop_indexes_sql
}
)
,
%W(gzip -c)
,
%W(gzip
-1
-c)
,
out:
[
db_file_name
,
'w'
,
0600
]
)
if
!
statuses
.
compact
.
all?
(
&
:success?
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment