mirror of https://github.com/borgbackup/borg.git
flush json mode progress stderr output
if borg stderr is not connected to a tty, but to ssh (when using
borg client/server), sys.stderr is block buffered (tty: line buffered).
thus we better flush explicitly after emitting a line as the receiving
side can not handle partial json at the end of the block.
also, it might solve some delays, when output didn't arrive at
receiving side in time.
(cherry picked from commit 2b75b278da
)
This commit is contained in:
parent
ca0cb31277
commit
f44fd6ba19
|
@ -1444,7 +1444,7 @@ class ProgressIndicatorBase:
|
||||||
finished=finished,
|
finished=finished,
|
||||||
time=time.time(),
|
time=time.time(),
|
||||||
))
|
))
|
||||||
print(json.dumps(kwargs), file=sys.stderr)
|
print(json.dumps(kwargs), file=sys.stderr, flush=True)
|
||||||
|
|
||||||
def finish(self):
|
def finish(self):
|
||||||
if self.json:
|
if self.json:
|
||||||
|
|
Loading…
Reference in New Issue