repaired bug in total request time calc, particularly when a request returns no response
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 20 Dec 2010 02:54:32 +0000 (02:54 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 20 Dec 2010 02:54:32 +0000 (02:54 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@2136 9efc2488-bf62-4759-914b-345cdb29e865

src/python/srfsh.py

index 519c12b..e41adc5 100755 (executable)
@@ -280,6 +280,7 @@ class Srfsh(object):
         req = ses.request2(method, tuple(params))
 
         last_content = None
+        total = 0
         while True:
             resp = None
 
@@ -287,12 +288,12 @@ class Srfsh(object):
                 resp = req.recv(timeout=self.timeout)
             except osrf.net.XMPPNoRecipient:
                 self.report("Unable to communicate with %s\n" % service)
-                total = 0
                 break
 
+            total = time.time() - start
+
             if not resp: break
 
-            total = time.time() - start
             content = resp.content()
 
             if content is not None: