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

Handle rate limite error #9

Open
maniolias opened this issue May 18, 2022 · 0 comments
Open

Handle rate limite error #9

maniolias opened this issue May 18, 2022 · 0 comments

Comments

@maniolias
Copy link
Member

Current behavior

If we do too many delete :

{
    "name": "HttpError",
    "status": 403,
    "response": {
        "url": "xxxxxxx",
        "status": 403,
        "headers": {
            "access-control-allow-origin": "*",
            "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
            "connection": "close",
            "content-encoding": "gzip",
            "content-security-policy": "default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com objects-origin.githubusercontent.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com cdn.optimizely.com logx.optimizely.com/v1/events translator.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src render.githubusercontent.com viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com objects-origin.githubusercontent.com secured-user-images.githubusercontent.com/; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; worker-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/",
            "content-type": "application/json; charset=utf-8",
            "date": "Wed, 18 May 2022 15:01:45 GMT",
            "expect-ct": "max-age=2592000, report-uri=\"[https://api.github.com/_private/browser/errors](https://api.github.com/_private/browser/errors/)\"",
            "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
            "retry-after": "60",
            "server": "GitHub.com",
            "strict-transport-security": "max-age=31536000; includeSubdomains; preload",
            "transfer-encoding": "chunked",
            "vary": "Accept-Encoding, Accept, X-Requested-With",
            "x-content-type-options": "nosniff",
            "x-frame-options": "deny",
            "x-github-media-type": "github.v3; format=json",
            "x-github-request-id": "0749: 717F: 2278DB: 24ADCC: 62850A59",
            "x-xss-protection": "0"
        },
        "data": {
            "documentation_url": "https: //docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits",
            "message": "You have exceeded a secondary rate limit. Please wait a few minutes before you try again."
        }
    },
    "request": {
        "method": "DELETE",
        "url": "xxxxxxxxx",
        "headers": {
            "accept": "application/vnd.github.-preview+json",
            "user-agent": "actions/github-script octokit-core.js/3.5.1 Node.js/12.22.7 (linux; x64)",
            "authorization": "token [REDACTED]",
            "content-length": 0
        },
        "request": {
            "agent": {
                "_events": {},
                "_eventsCount": 2,
                "defaultPort": 443,
                "protocol": "https:",
                "options": {
                    "path": null
                },
                "requests": {},
                "sockets": {},
                "freeSockets": {},
                "keepAliveMsecs": 1000,
                "keepAlive": false,
                "maxSockets": null,
                "maxFreeSockets": 256,
                "maxTotalSockets": null,
                "totalSocketCount": 0,
                "scheduling": "fifo",
                "maxCachedSessions": 100,
                "_sessionCache": {
                    "map": {
                        "api.github.com:443::::::::::::::::::": {
                            "type": "Buffer",
                            "data": []
                        }
                    },
                    "list": [
                        "api.github.com:443::::::::::::::::::"
                    ]
                }
            }
        }
    }
}

Expected behavior

If we get rate limit error, juste wait for retry-after value from headers

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

No branches or pull requests

1 participant