Trigger SF auth in app context
- SF client initializes without auth
- doesn't lock logs on auth failure
Change-Id: Icfdd9b89277ee7df6b78833dabd9576e7ebbd3ab
Related-PROD: PRODX-34058
diff --git a/sf_notifier/server.py b/sf_notifier/server.py
index 2b919e2..0996d4a 100644
--- a/sf_notifier/server.py
+++ b/sf_notifier/server.py
@@ -27,6 +27,10 @@
sf_cli = SalesforceClient(settings.SF_CONFIG, prometheus_registry=registry)
+with app.app_context():
+ sf_cli.auth()
+
+
@app.route('/metrics', methods=['GET'])
def metrics():
return Response(generate_latest(registry),