Skip to content

Commit 7ff10b3

Browse files
Ryrdensinedied
authored andcommitted
docs: added a debug and change comment
1 parent f4e3a29 commit 7ff10b3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/api.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ async function retryRequest(fn: () => Promise<RemoteArticleData>, retries: numbe
3131
if (retries === 0 || !(error instanceof RequestError && error.response?.statusCode === 429)) {
3232
throw error;
3333
}
34+
debug('Rate limited, retrying in %s ms', retryDelay);
3435
await delay(retryDelay);
3536
return retryRequest(fn, retries - 1);
3637
}
@@ -96,7 +97,7 @@ export async function updateRemoteArticle(article: Article, devtoKey: string): P
9697
try {
9798
const markdown = matter.stringify(article, article.data, { lineWidth: -1 } as any);
9899
const { id } = article.data;
99-
// Throttle API calls in case of article creation
100+
// Throttle API calls in case of article creation or update
100101
const get = id ? throttledPutForUpdate : throttledPostForCreate;
101102
const result = await get(`${apiUrl}/articles${id ? `/${id}` : ''}`, {
102103
headers: { 'api-key': devtoKey },

0 commit comments

Comments
 (0)