{"action":"created","issue":{"url":"https://api.github.com/repos/AniList/ApiV2-GraphQL-Docs/issues/20","repository_url":"https://api.github.com/repos/AniList/ApiV2-GraphQL-Docs","labels_url":"https://api.github.com/repos/AniList/ApiV2-GraphQL-Docs/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/AniList/ApiV2-GraphQL-Docs/issues/20/comments","events_url":"https://api.github.com/repos/AniList/ApiV2-GraphQL-Docs/issues/20/events","html_url":"https://github.com/AniList/ApiV2-GraphQL-Docs/issues/20","id":296431124,"number":20,"title":"How to determine ratelimit reset","user":{"login":"brussell98","id":16432550,"avatar_url":"https://avatars2.githubusercontent.com/u/16432550?v=4","gravatar_id":"","url":"https://api.github.com/users/brussell98","html_url":"https://github.com/brussell98","followers_url":"https://api.github.com/users/brussell98/followers","following_url":"https://api.github.com/users/brussell98/following{/other_user}","gists_url":"https://api.github.com/users/brussell98/gists{/gist_id}","starred_url":"https://api.github.com/users/brussell98/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brussell98/subscriptions","organizations_url":"https://api.github.com/users/brussell98/orgs","repos_url":"https://api.github.com/users/brussell98/repos","events_url":"https://api.github.com/users/brussell98/events{/privacy}","received_events_url":"https://api.github.com/users/brussell98/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-12T16:10:24Z","updated_at":"2018-02-12T22:55:47Z","closed_at":"2018-02-12T22:55:47Z","author_association":"NONE","body":"I'm currently working on migrating to the new API, but I'm having trouble determining how to handle ratelimiting.\r\n\r\nFrom the docs, a `x-ratelimit-reset` header is only provided when you go over the ratelimit, which isn't very helpful in avoiding that. I did some testing and noticed that it resets at different times. Once at ~13 seconds and once ~38 seconds, so syncing with 00 seconds won't work either. If I could have a more sure way, such as always having the header, it would help me avoid accidentally going over the limit or having to pause for arbitrary amounts of time."},"comment":{"url":"https://api.github.com/repos/AniList/ApiV2-GraphQL-Docs/issues/comments/365091716","html_url":"https://github.com/AniList/ApiV2-GraphQL-Docs/issues/20#issuecomment-365091716","issue_url":"https://api.github.com/repos/AniList/ApiV2-GraphQL-Docs/issues/20","id":365091716,"user":{"login":"joshstar","id":7507582,"avatar_url":"https://avatars3.githubusercontent.com/u/7507582?v=4","gravatar_id":"","url":"https://api.github.com/users/joshstar","html_url":"https://github.com/joshstar","followers_url":"https://api.github.com/users/joshstar/followers","following_url":"https://api.github.com/users/joshstar/following{/other_user}","gists_url":"https://api.github.com/users/joshstar/gists{/gist_id}","starred_url":"https://api.github.com/users/joshstar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshstar/subscriptions","organizations_url":"https://api.github.com/users/joshstar/orgs","repos_url":"https://api.github.com/users/joshstar/repos","events_url":"https://api.github.com/users/joshstar/events{/privacy}","received_events_url":"https://api.github.com/users/joshstar/received_events","type":"User","site_admin":false},"created_at":"2018-02-12T22:55:46Z","updated_at":"2018-02-12T22:55:46Z","author_association":"OWNER","body":"Ah okay sorry I understand what you mean now. At what time does the rate-limit period end, so you can make sure to not go over the limit before that and just wait out the remaining time instead of waiting the for timeout minute to end.\r\n\r\nI've added the `x-ratelimit-reset` header to all responses and that will have the timestamp of when the rate-limit period ends and your request limit count resets.\r\n\r\nCurrently we do have a bit of an issue where our cache drivers time is a little out of sync with real time, so technically the rate limit may be reset a couple seconds early but I'll be getting that fixed within the next couple days."}}
{"actor":{"display_login":"joshstar"}}