Utilities/BackgroundService.py

changeset 5875
3052fb9cf357
parent 5874
a28f7d2ff976
child 5901
96bb9e46ec89
--- a/Utilities/BackgroundService.py	Sun Sep 03 19:08:22 2017 +0200
+++ b/Utilities/BackgroundService.py	Sun Sep 03 19:16:43 2017 +0200
@@ -161,9 +161,10 @@
             
             packedData = b''
             while len(packedData) < length:
-                # this wait influences speed in batch mode (smaller is faster)
-                connection.waitForReadyRead(5)
-                packedData += connection.read(length - len(packedData))
+                maxSize = length - len(packedData)
+                if connection.bytesAvailable() < maxSize:
+                    connection.waitForReadyRead(50)
+                packedData += connection.read(maxSize)
 
             assert adler32(packedData) & 0xffffffff == datahash, \
                 'Hashes not equal'

eric ide

mercurial