Browse Source

Merge pull request #1686 from clay4444/fixSignOutBug

Fix SessionService signOut method exception handle bug
pull/2/head
Tboy 5 years ago committed by GitHub
parent
commit
95dedd94f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SessionService.java
  2. 3
      dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/SessionServiceTest.java

4
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SessionService.java

@ -139,7 +139,6 @@ public class SessionService extends BaseService{
* @param loginUser login user * @param loginUser login user
*/ */
public void signOut(String ip, User loginUser) { public void signOut(String ip, User loginUser) {
try {
/** /**
* query session by user id and ip * query session by user id and ip
*/ */
@ -147,8 +146,5 @@ public class SessionService extends BaseService{
//delete session //delete session
sessionMapper.deleteById(session.getId()); sessionMapper.deleteById(session.getId());
}catch (Exception e){
}
} }
} }

3
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/SessionServiceTest.java

@ -121,6 +121,9 @@ public class SessionServiceTest {
String ip = "127.0.0.1"; String ip = "127.0.0.1";
User user = new User(); User user = new User();
user.setId(userId); user.setId(userId);
Mockito.when(sessionMapper.queryByUserIdAndIp(userId,ip)).thenReturn(getSession());
sessionService.signOut(ip ,user); sessionService.signOut(ip ,user);
} }

Loading…
Cancel
Save