Remove the declaration of global variables from the run method. #180
This commit is contained in:
parent
d15099b456
commit
9503089642
1 changed files with 2 additions and 4 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue