Skip to content

Commit

Permalink
fix(background): 更新 lccn.lbao.site 的 api 地址
Browse files Browse the repository at this point in the history
  • Loading branch information
XYShaoKang committed Nov 4, 2023
1 parent 71c4edd commit 1cab345
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/background/utils/lbaoAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ export const lbaoPredictorApi = async (
users: { data_region: string; username: string }[],
retry = 5
): Promise<LbaoPredictorType[]> => {
const res = await fetch('https://lccn.lbao.site/predict_records', {
method: 'POST',
body: JSON.stringify({
contest_name,
users,
}),
headers: { 'content-type': 'application/json' },
})
const res = await fetch(
'https://lccn.lbao.site/api/v1/contest-records/predicted-rating',
{
method: 'POST',
body: JSON.stringify({
contest_name,
users,
}),
headers: { 'content-type': 'application/json' },
}
)
if (retry && res.status === 503) {
await sleep(2000)
return lbaoPredictorApi(contest_name, users, retry - 1)
Expand Down

0 comments on commit 1cab345

Please sign in to comment.