-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add zuora auth logging so we can debug failures easily #192
Conversation
@@ -36,7 +36,10 @@ object ZuoraAuth extends JsonSupport { | |||
*/ | |||
var accessToken: String = _ | |||
private def getAccessToken(): String = { | |||
Http(s"$zuoraApiHost/oauth/token") | |||
val logger = java.util.logging.Logger.getGlobal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is what it uses elsewhere in this lambda
.pipe(read[AccessToken](_)) | ||
.access_token | ||
} | ||
private val timer = new Timer() | ||
private val timer = new Timer(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes this timer a daemon, meaning it doesn't keep the JVM running when the main thread has terminated
https://docs.oracle.com/javase/8/docs/api/java/util/Timer.html#Timer-boolean-
.foreach(token => accessToken = token) | ||
} | ||
}, | ||
0, | ||
5 * 60 * 1000, // refresh token every 5 min | ||
five_minutes, // wait 5 mins for first refresh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed it was doing a double auth on startup.
the attempt below happens on app startup, so the initial delay should have been 5 minutes.
original PR it's not mentioned and was probably not considered #16
@@ -35,8 +35,11 @@ object ZuoraAuth extends JsonSupport { | |||
* again. Hence now we periodically refreshes the token (making it def would have performance penalty) | |||
*/ | |||
var accessToken: String = _ | |||
private def getAccessToken(): String = { | |||
Http(s"$zuoraApiHost/oauth/token") | |||
private def getAccessToken: String = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty brackets was a warning in intellij
There's an exception in initialiser error in CODE for zuora auth and we can't work out why it doesn't work.
This logging should tell us more about the interaction with zuora.
Logging looks something like this in DEV locally (I've replaced all ids with 1234)