mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 23:39:11 -05:00
stats: Clean up now-unnecessary checks for Timer validity.
This commit is contained in:
@@ -527,8 +527,7 @@ def basic_query(query=None, bq=None, faceting=None, size=1000,
|
||||
timer = None
|
||||
if record_stats:
|
||||
timer = g.stats.get_timer("cloudsearch_timer")
|
||||
if timer:
|
||||
timer.start()
|
||||
timer.start()
|
||||
connection = httplib.HTTPConnection(search_api, 80)
|
||||
try:
|
||||
connection.request('GET', path)
|
||||
@@ -551,8 +550,7 @@ def basic_query(query=None, bq=None, faceting=None, size=1000,
|
||||
response)
|
||||
finally:
|
||||
connection.close()
|
||||
if timer:
|
||||
timer.stop()
|
||||
timer.stop()
|
||||
|
||||
return json.loads(response)
|
||||
|
||||
|
||||
@@ -89,8 +89,7 @@ class Stats:
|
||||
|
||||
def transact(self, action, service_time_sec):
|
||||
timer = self.get_timer('service_time')
|
||||
if timer:
|
||||
timer.send(action, service_time_sec)
|
||||
timer.send(action, service_time_sec)
|
||||
|
||||
def get_counter(self, name):
|
||||
if self.connection:
|
||||
|
||||
Reference in New Issue
Block a user