fix: duplicate key

This commit is contained in:
sagitchu 2025-03-18 19:53:59 +08:00
parent d2fdcc23d8
commit d05d52913b
2 changed files with 25 additions and 9 deletions

View File

@ -25,15 +25,33 @@ jobs:
const upstream = 'songquanpeng/one-api';
const [owner, repo] = upstream.split('/');
// 获取上游仓库的PR
// 使用分页获取所有上游仓库的PR
async function getAllPRs() {
let page = 1;
let allPulls = [];
while (true) {
const pulls = await github.rest.pulls.list({
owner,
repo,
state: 'open'
state: 'open',
per_page: 100, // 每页获取最大数量
page: page
});
if (pulls.data.length === 0) break;
allPulls = allPulls.concat(pulls.data);
page++;
}
return allPulls;
}
// 获取所有PR
const pulls = await getAllPRs();
console.log(`Found ${pulls.length} open PRs in upstream repository`);
// 为每个PR创建或更新对应的PR
for (const pull of pulls.data) {
for (const pull of pulls) {
try {
const branchName = `upstream-pr-${pull.number}`;

View File

@ -101,8 +101,6 @@ var ModelRatio = map[string]float64{
"claude-3-7-sonnet-20250219": 3.0 / 1000 * USD,
"claude-3-7-sonnet-latest": 3.0 / 1000 * USD,
"claude-3-opus-20240229": 15.0 / 1000 * USD,
"claude-3-7-sonnet-20250219": 3.0 / 1000 * USD,
"claude-3-7-sonnet-latest": 3.0 / 1000 * USD,
// https://cloud.baidu.com/doc/WENXINWORKSHOP/s/hlrk4akp7
"ERNIE-4.0-8K": 0.120 * RMB,
"ERNIE-3.5-8K": 0.012 * RMB,