aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webmap-download-mrr.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/webmap-download-mrr.py b/webmap-download-mrr.py
index db3fda7..2c9d3b0 100644
--- a/webmap-download-mrr.py
+++ b/webmap-download-mrr.py
@@ -56,11 +56,12 @@ class WMS:
self.version = version
def __del__(self):
- if self.req_count is not None and self.url is not None:
- self.print_req_count()
+ self.print_req_count()
def print_req_count(self, elapsed=None):
- if elapsed is None:
+ if self.req_count is None or self.url is None:
+ return
+ elif elapsed is None:
logging.info('%d WMS requests sent to %s', self.req_count, self.url)
else:
logging.info('%d WMS requests (%.2f req/s) sent to %s', self.req_count,
@@ -354,6 +355,7 @@ class WMS:
probes.append( (poly0.MakeValid(), probe_count) )
if len(probes) == 0:
+ self.req_count = None # don't print request count
return {}, crs
features = {}