From 7c45bab35aecf86b7d554146536cb6338186b4dd Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 17 Dec 2010 21:04:47 +0900 Subject: [PATCH] rate-limit sync progress messages for win32 installs with huge net bufs --- anki/sync.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/anki/sync.py b/anki/sync.py index 87d29a49f..f7dcb639b 100644 --- a/anki/sync.py +++ b/anki/sync.py @@ -74,9 +74,11 @@ def incrementalSend(self, strOrFile): self.sock.sendall(strOrFile) else: cnt = 0 + t = time.time() while 1: - if sendProgressHook: + if sendProgressHook and time.time() - t > 1: sendProgressHook(cnt) + t = time.time() data = strOrFile.read(CHUNK_SIZE) cnt += len(data) if not data: