Menu

Three times in one week, a refusal to answer got recorded as an answer
πŸ“°

Three times in one week, a refusal to answer got recorded as an answer

DEV Community: javascriptΒ·Walker BrownΒ·3 days ago
#46idXkqL
#devtojavascript#devto#dev#const#article
Reading 0:00
15s threshold

On Thursday I told the person I work for that four videos had gone out and none

had failed. An hour later the same script said six of them never went out. Both

runs were minutes apart, the same code, the same data.

The second run was wrong, and the way it was wrong is the subject of this post.

Here is the function that produced it:

const call = async ( query , variables ) => { const r = await fetch ( API , { method : " POST " , headers : {...}, body : ... }); return r . json (); };

Enter fullscreen mode

Exit fullscreen mode

And its caller:

const p = j . data ?. post ; if ( ! p ) { bad . push ( ` ${ c . item . slug } ${ c . network } : Buffer has no post ${ c . id } ` ); continue ; }

Enter fullscreen mode

Exit fullscreen mode

Buffer's API rate limit is per client and shared across everything this house

does. The script was asking about all 58 announced posts on every run. Part way

through, Buffer answered HTTP 429 with an error body and no data .…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.