This commit is contained in:
parent
6ead97eee0
commit
9fec4e81cc
@ -26,7 +26,6 @@ if SENTRY_DSN:
|
|||||||
environment = os.environ.get('RELEASEMODE', 'dev')
|
environment = os.environ.get('RELEASEMODE', 'dev')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.config['REDIS_URL'] = os.environ['REDIS_URL']
|
app.config['REDIS_URL'] = os.environ['REDIS_URL']
|
||||||
app.config['LOCAL_UUID'] = os.environ['LOCAL_UUID']
|
app.config['LOCAL_UUID'] = os.environ['LOCAL_UUID']
|
||||||
|
@ -10,6 +10,7 @@ def client():
|
|||||||
with current_app.test_client() as client:
|
with current_app.test_client() as client:
|
||||||
yield client
|
yield client
|
||||||
|
|
||||||
|
|
||||||
def test_response_length(client):
|
def test_response_length(client):
|
||||||
r = client.post('/log')
|
r = client.post('/log')
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ from flask_classful import FlaskView
|
|||||||
class ConsumersView(FlaskView):
|
class ConsumersView(FlaskView):
|
||||||
|
|
||||||
def get(self):
|
def get(self):
|
||||||
|
|
||||||
keys = redis_client.keys('consumer_*')
|
keys = redis_client.keys('consumer_*')
|
||||||
|
|
||||||
list_of_customer_ips = []
|
list_of_customer_ips = []
|
||||||
|
@ -19,7 +19,8 @@ class LogView(FlaskView):
|
|||||||
if not last_known_remote_ip:
|
if not last_known_remote_ip:
|
||||||
current_app.logger.info(f"New producer {remote_uuid} at {remote_ip}")
|
current_app.logger.info(f"New producer {remote_uuid} at {remote_ip}")
|
||||||
elif last_known_remote_ip != remote_ip:
|
elif last_known_remote_ip != remote_ip:
|
||||||
current_app.logger.info(f"IP address of producer {remote_uuid} have changed: {last_known_remote_ip} -> {remote_ip}")
|
current_app.logger.info(
|
||||||
|
f"IP address of producer {remote_uuid} have changed: {last_known_remote_ip} -> {remote_ip}")
|
||||||
|
|
||||||
# update expirity
|
# update expirity
|
||||||
redis_client.set(prod_key, remote_ip.encode('utf-8'))
|
redis_client.set(prod_key, remote_ip.encode('utf-8'))
|
||||||
|
Reference in New Issue
Block a user