mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2026-11-17 10:35:40 +00:00
Sane default buffer size in backup_from_stdin
This commit is contained in:
1 parent
fa1c982bf5
commit
187787425a
1 file changed
+2
-5
@@ -40,11 +40,8 @@ def backup_from_stdin(repository: str, filename: str, source_command: List[str])
|
|||||||
])
|
])
|
||||||
|
|
||||||
# pipe source command into dest command
|
# pipe source command into dest command
|
||||||
# NOTE: Using the default buffer size: io.DEFAULT_BUFFER_SIZE = 8192
|
source_process = Popen(source_command, stdout=PIPE, bufsize=65536)
|
||||||
# We might want to tweak that to speed up large dumps.
|
dest_process = Popen(dest_command, stdin=source_process.stdout, stdout=PIPE, stderr=PIPE, bufsize=65536)
|
||||||
# Actual tests tests must be done.
|
|
||||||
source_process = Popen(source_command, stdout=PIPE)
|
|
||||||
dest_process = Popen(dest_command, stdin=source_process.stdout, stdout=PIPE, stderr=PIPE)
|
|
||||||
stdout, stderr = dest_process.communicate()
|
stdout, stderr = dest_process.communicate()
|
||||||
|
|
||||||
# Ensure both processes exited with code 0
|
# Ensure both processes exited with code 0
|
||||||
|
|||||||
Reference in new issue
Block a user