From 950308964248d7aa54ae4bcd717866f19a640f6e Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Fri, 26 Apr 2019 03:10:16 +0000 Subject: [PATCH] Remove the declaration of global variables from the run method. #180 --- utils/rider_location_cache/rider_location_cache.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/utils/rider_location_cache/rider_location_cache.py b/utils/rider_location_cache/rider_location_cache.py index e96cba0e..cbd1bd4b 100644 --- a/utils/rider_location_cache/rider_location_cache.py +++ b/utils/rider_location_cache/rider_location_cache.py @@ -12,14 +12,10 @@ import json class RiderLocationCache(object): def run(self): - global client, redis_conn - client = mqtt.Client() client.on_connect = on_connect # client.on_publish = on_publish client.on_message = on_message - redis_conn = redis.StrictRedis(host='localhost', port=6379, db=0) - #client.tls_set( # "/etc/letsencrypt/live/resqaws.jankstudio.com/fullchain.pem", cert_reqs=ssl.CERT_NONE, # tls_version=ssl.PROTOCOL_TLSv1) @@ -36,6 +32,8 @@ class RiderLocationCache(object): #signal.signal(signal.SIGINT, sigint_handler) client.loop_forever() +client = mqtt.Client() +redis_conn = redis.StrictRedis(host='localhost', port=6379, db=0) def init_subscriptions(client): print "subscribing to wildcard"