mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-24 08:45:13 +00:00
Remove potential busy wait for remote stores
This commit is contained in:
parent
6c77ce53d9
commit
8dc057a70e
1 changed files with 3 additions and 3 deletions
|
@ -108,9 +108,9 @@ def __init__(self, location, create=False):
|
|||
self.msgid = 0
|
||||
self.id, self.tid = self.cmd('open', (location.path, create))
|
||||
|
||||
def wait(self):
|
||||
def wait(self, write=True):
|
||||
with self.channel.lock:
|
||||
if (self.channel.out_window_size == 0 and
|
||||
if ((not write or self.channel.out_window_size == 0) and
|
||||
not self.channel.recv_ready() and
|
||||
not self.channel.recv_stderr_ready()):
|
||||
self.channel.out_buffer_cv.wait(10)
|
||||
|
@ -145,7 +145,7 @@ def cmd(self, cmd, args, callback=None, callback_data=None):
|
|||
if not odata and callback:
|
||||
return
|
||||
else:
|
||||
self.wait()
|
||||
self.wait(odata)
|
||||
|
||||
def commit(self, *args):
|
||||
self.cmd('commit', args)
|
||||
|
|
Loading…
Reference in a new issue