The Movie Database Support

Hello,

I am having troubles with the x-ratelimit-reset header. Based on this post (https://www.themoviedb.org/talk/5317af69c3a3685c4a0003b1), I understood that this header corresponds to the epoch timestamps when the counter is reset. The problem I have is when I compare it with a "current" timestamp after a request, I get a number of seconds greater than 10 (15-16s most of the time). So I thought you had changed the timeframe, but when I looked at the date header sent back by your server, I found it was actually in the "future" compared with a timestamp on my machine.

I checked my machine against this source (http://www.epochconverter.com/) and I'm pretty much on time. However, your server seems to be rushing by 8-10 seconds. Consequently, there's no way for me to know when I will really be able to make new requests. It might be a good idea to send the number of seconds (or milliseconds) remaining before we can make new requests; so that you don't care at all if the server's on time.

What do you think ?

Other than that, awesome work, this API is great !

1 svar (på sida 1 av 1)

Jump to last post

Hi WaldoJeffers,

You should be able to keep track of the reset by storing the time of the first request you make (or once the counter has been reset). With that initial time you can calculate the offset in relation to the time we return by the Date header. Since we reset the counter every 10 seconds (or simply at the time specified by X-RateLimit-Reset you can accurately gauge when the next reset will be local to whatever time your client is returning.

For what it's worth, I just tested the time our servers are reporting and they are within 1 second (less than) of what epochconverter.com is reporting.

Kan du inte hitta en film eller tv-serie? Logga in för att skapa den.

Globala

s fokus på sökrutan
p öppna profilmenyn
esc stäng ett öppet fönster
? öppna tangentbordsgenväg fönstret

På mediasidor

b gå tillbaka (eller till förälder när det är tillämpligt)
e gå till redigerings sidan

På tv-säsongssidor

(höger pil) gå till nästa säsong
(vänster pil) gå till den föregående säsongen

På tv-avsnittssidor

(höger pil) gå till nästa avsnitt
(vänster pil) gå till föregående avsnitt

På alla bildsidor

a öppna lägg till bild fönstret

På alla redigeringssidor

t öppna översättnings väljaren
ctrl+ s skicka förmulär

På diskussionssidor

n skapa ny diskussion
w växla sedd-status
p växla offentligt/privat
c växla stäng/öppna
a öppna aktivitet
r svara på diskussionen
l gå till det senaste svaret
ctrl+ enter skicka ditt meddelande
(höger pil) nästa sida
(vänster pil) föregående sida

Inställningar

Vill du betygsätta denna artikel eller lägga till den i en lista?

Logga in