Browse Source

处理死锁

dev-restore_mount
fanshuai 1 year ago
parent
commit
81366d0edd
2 changed files with 3 additions and 4 deletions
  1. +1
    -1
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/GitService.java
  2. +2
    -3
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/GitServiceImpl.java

+ 1
- 1
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/GitService.java View File

@@ -23,5 +23,5 @@ public interface GitService {


void deleteBranch(String owner,String projectName ,String branchName) throws Exception; void deleteBranch(String owner,String projectName ,String branchName) throws Exception;


Map getUserInfo() throws Exception;
Map getUserInfo(String token) throws Exception;
} }

+ 2
- 3
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/GitServiceImpl.java View File

@@ -81,7 +81,7 @@ public class GitServiceImpl implements GitService {
token = jedis.get(ci4sUsername + "_gitToken"); token = jedis.get(ci4sUsername + "_gitToken");
} else { } else {
try { try {
Map userInfo = getUserInfo();
Map userInfo = getUserInfo(token);
if (userInfo == null || (userInfo.get("status") != null && 401 == (Integer) userInfo.get("status"))) { if (userInfo == null || (userInfo.get("status") != null && 401 == (Integer) userInfo.get("status"))) {
login(gitLinkUsername, gitLinkPassword); login(gitLinkUsername, gitLinkPassword);
token = jedis.get(ci4sUsername + "_gitToken"); token = jedis.get(ci4sUsername + "_gitToken");
@@ -152,8 +152,7 @@ public class GitServiceImpl implements GitService {
} }


@Override @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); String userReq = HttpUtils.sendGetWithToken("https://www.gitlink.org.cn/api/users/get_user_info.json",null, token);
if (StringUtils.isEmpty(userReq)){ if (StringUtils.isEmpty(userReq)){
return null; return null;


Loading…
Cancel
Save