Skip to content
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

Enhance Github API Key Handling #2951

Open
ABrain7710 opened this issue Nov 13, 2024 · 1 comment
Open

Enhance Github API Key Handling #2951

ABrain7710 opened this issue Nov 13, 2024 · 1 comment
Assignees

Comments

@ABrain7710
Copy link
Contributor

ABrain7710 commented Nov 13, 2024

Key Manager Logic

  • Handle Key Request
    • Check if any expired keys are now valid
    • Pick random key and send key response on redis channel
    • If no valid keys available send key response that indicates no keys are available with the time to sleep
  • Handle Key Expired
    • Move key from ready list to expired keys list

Celery Worker

  • Retrieve a new key

    • Publish request for key
    • Poll for response
    • When success response is received on the channel use it
    • When no keys available error response is received on the channel sleep for the time indicated then request again
  • Key runs out of requests

    • Send message on channel that the key has expired
    • Retrieve a new key
@ABrain7710 ABrain7710 converted this from a draft issue Nov 13, 2024
@Ulincsys
Copy link
Contributor

KeyClient superclass description:

class KeyClient:
    def get_key(self, ...): ...
    def expire_key(self, key, ...): ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

2 participants