-
Notifications
You must be signed in to change notification settings - Fork 41
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
Cache the Authorization request/response to not get rate limited #20
Comments
I'm having the same issue, need to reauthenticate every 24 hours. Getting: "Received error from B2: Authorization token has expired" |
Caching that token requires an external storage system. One could implement this using an interface However, the system is a bit more complex in fact. You have both upload tokens, api tokens and download tokens. Each of those is independant and has it's own validity. And you cannot have more than 10 simultaneous upload tokens. Quite a bit restrictions in fact making a cache system quite complex... |
Receiving massive |
@philhagen This is absolutely related. I "fixed" this by caching it. But as @iammichiel says it's more complex and apparently there are many different types of tokens and so on; perhaps one of the reasons I'm actually experiencing weird behaviour even in production. I feel a fork would be needed, or new maintainers. I'd be happy to help as long as someone would join me in it as I can't do it by myself (time, etc etc). |
I created a pull request #22 which allows caching by extracting and inserting the authorization object/token. As far as i can see from the B2 API docs the authorizationToken is the only token which expires after 24 hours. |
I forked the repo and merging the PRs in there. You can access it here: https://github.com/tarikozket/b2-sdk-php |
Backblaze API requires you to cache this in order to not get rate limited.
Will hopefully be able to provide you with a PR.
The text was updated successfully, but these errors were encountered: