处理死锁

This commit is contained in:
fanshuai 2024-09-06 16:44:17 +08:00
parent 53046a939a
commit 81366d0edd
2 changed files with 3 additions and 4 deletions

View File

@ -23,5 +23,5 @@ public interface GitService {
void deleteBranch(String owner,String projectName ,String branchName) throws Exception;
Map getUserInfo() throws Exception;
Map getUserInfo(String token) throws Exception;
}

View File

@ -81,7 +81,7 @@ public class GitServiceImpl implements GitService {
token = jedis.get(ci4sUsername + "_gitToken");
} else {
try {
Map userInfo = getUserInfo();
Map userInfo = getUserInfo(token);
if (userInfo == null || (userInfo.get("status") != null && 401 == (Integer) userInfo.get("status"))) {
login(gitLinkUsername, gitLinkPassword);
token = jedis.get(ci4sUsername + "_gitToken");
@ -152,8 +152,7 @@ public class GitServiceImpl implements GitService {
}
@Override
public Map getUserInfo() throws Exception {
String token = this.checkoutToken();
public Map getUserInfo(String token) throws Exception {
String userReq = HttpUtils.sendGetWithToken("https://www.gitlink.org.cn/api/users/get_user_info.json",null, token);
if (StringUtils.isEmpty(userReq)){
return null;