mirror of
https://github.com/reiyua/github-profile-trophy-reiyua-mirror.git
synced 2026-11-17 06:02:09 +11:00
fix: Temporary fix for retry bug
This commit is contained in:
parent
af753bf270
commit
b4aa73dea1
1 changed files with 6 additions and 6 deletions
|
|
@ -120,17 +120,17 @@ export class GithubApiService extends GithubRepository {
|
|||
CONSTANTS.DEFAULT_GITHUB_RETRY_DELAY,
|
||||
);
|
||||
const response = await retry.fetch<Promise<T>>(async ({ attempt }) => {
|
||||
return await soxa.post("", {}, {
|
||||
const res = await soxa.post("", {}, {
|
||||
data: { query: query, variables },
|
||||
headers: {
|
||||
Authorization: `bearer ${TOKENS[attempt]}`,
|
||||
},
|
||||
});
|
||||
}) as QueryDefaultResponse<{ user: T }>;
|
||||
|
||||
if (response?.data?.errors) {
|
||||
return this.handleError(response?.data?.errors);
|
||||
if (res?.data?.errors) {
|
||||
return this.handleError(res?.data?.errors);
|
||||
}
|
||||
return res;
|
||||
}) as QueryDefaultResponse<{ user: T }>;
|
||||
|
||||
return response?.data?.data?.user ??
|
||||
new ServiceError("not found", EServiceKindError.NOT_FOUND);
|
||||
|
|
@ -146,7 +146,7 @@ export class GithubApiService extends GithubRepository {
|
|||
Logger.error(error);
|
||||
}
|
||||
|
||||
return new ServiceError("not found", EServiceKindError.NOT_FOUND);
|
||||
return new ServiceError("Rate limit exceeded", EServiceKindError.RATE_LIMIT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue