You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As it stands there appears to be no easy way to refresh the apiToken of a ManagementApi. Since the token used here has an expiration, a new ManagementApi requires instantiating with a new valid token when this occurs.
The problem arises with the use of the OkHttpClient instantiated with a ManagementApi. This leads to a memory leak, as each successive ManagementApi creates a new OkHttpClient that is never cleaned up.
As it stands there appears to be no easy way to refresh the
apiToken
of aManagementApi
. Since the token used here has an expiration, a newManagementApi
requires instantiating with a new valid token when this occurs.The problem arises with the use of the
OkHttpClient
instantiated with aManagementApi
. This leads to a memory leak, as each successiveManagementApi
creates a newOkHttpClient
that is never cleaned up.A similar issue was addressed here: square/okhttp#2846
A setter for the apiToken would alleviate this issue, allowing it to be updated without the need to re-instantiate the
ManagementApi
The text was updated successfully, but these errors were encountered: