Coder Social home page Coder Social logo

Access token refresh about igdb-laravel HOT 1 OPEN

marcreichel avatar marcreichel commented on July 18, 2024
Access token refresh

from igdb-laravel.

Comments (1)

marcreichel avatar marcreichel commented on July 18, 2024

Thank you for your kind words, really appreciate it! πŸ™‚


Normally, the token get's cached for the token lifetime (coming from Twitch) minus 60 seconds and if the cached token expired a new one is requested on the fly.

So generally speaking there should not be a case where the token for a request actually expires. The emphasis is on "should not" πŸ˜….

I do not doubt you running into that issue. So there might exist such a case for whatever reason.

For the solution I could think of some sort of "retry mechanism". You've mentioned, you're catching the exception, deleting the cached token and wait for the next request. I would take it a step further and retry the current request for n times (if it failed because the token expired) until it succeeds. If all n requests fail, finally throw an exception.

But maybe you meant just that by "next request".

The n should be globally configurable for each request via the package config file, but be overwritable per request as well. Just like the cache_lifetime config + cache method.

Taking these "ideas" into account I'll be happy to accept your pull request πŸ‘πŸΌπŸ™‚

from igdb-laravel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.