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
*/
public void signOut(String ip, User loginUser) {
try {
/**
* query session by user id and ip
*/
@ -147,8 +146,5 @@ public class SessionService extends BaseService{
//delete session
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";
User user = new User();
user.setId(userId);
Mockito.when(sessionMapper.queryByUserIdAndIp(userId,ip)).thenReturn(getSession());
sessionService.signOut(ip ,user);
}

Loading…
Cancel
Save