feat: 防止重新弄错代码行数

This commit is contained in:
tim
2025-08-10 02:14:43 +08:00
parent d5f52529f7
commit 7189977a2f

View File

@@ -28,8 +28,10 @@ public class ContributorService {
public void updateContributions() {
for (ContributorConfig config : repository.findAll()) {
long lines = fetchContributionLines(config.getGithubId());
config.setContributionLines(lines);
repository.save(config);
if (lines != -1) {
config.setContributionLines(lines);
repository.save(config);
}
}
}
@@ -41,7 +43,7 @@ public class ContributorService {
// 检查是否为202GitHub有时会返回202表示正在生成统计数据
if (response.getStatusCodeValue() == 202) {
log.warn("GitHub API 返回202统计数据正在生成中githubId: {}", githubId);
return 0;
return -1;
}
Object body = response.getBody();