From 9da2307bdf0ec0da1db4b8aae880b76379af94a0 Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 20 Dec 2010 02:54:32 +0000 Subject: [PATCH] repaired bug in total request time calc, particularly when a request returns no response git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@2136 9efc2488-bf62-4759-914b-345cdb29e865 --- src/python/srfsh.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/python/srfsh.py b/src/python/srfsh.py index 519c12b..e41adc5 100755 --- a/src/python/srfsh.py +++ b/src/python/srfsh.py @@ -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: -- 2.43.2