Browse Source

the current user quits and the session is completely emptied. bug fix (#987)

* add ConnectionFactoryTest and ConnectionFactory read datasource from appliction.yml

* .escheduler_env.sh to dolphinscheduler_env.sh

* dao yml assembly to conf directory

* table name modify

* entity title table  name modify

* logback log name modify

* running through the big process

* running through the big process error modify

* logback log name modify

* data_source.properties rename

* logback log name modify

* install.sh optimization

* install.sh optimization

* command count modify

* command state update

* countCommandState sql update

* countCommandState sql update

* remove application.yml file

* master.properties modify

* install.sh modify

* install.sh modify

* api server startup modify

* the current user quits and the session is completely emptied. bug fix
pull/2/head
qiaozhanwei 5 years ago committed by lgcareer
parent
commit
c9c2104ee0
  1. 8
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SessionService.java
  2. 2
      dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/SessionMapper.java
  3. 6
      dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/SessionMapper.xml

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

@ -140,11 +140,9 @@ public class SessionService extends BaseService{
/**
* query session by user id and ip
*/
List<Session> sessionList = sessionMapper.queryByUserId(loginUser.getId());
Session session = sessionMapper.queryByUserIdAndIp(loginUser.getId(),ip);
for (Session session : sessionList){
//delete session
sessionMapper.deleteById(session.getId());
}
//delete session
sessionMapper.deleteById(session.getId());
}
}

2
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/SessionMapper.java

@ -26,4 +26,6 @@ public interface SessionMapper extends BaseMapper<Session> {
List<Session> queryByUserId(@Param("userId") int userId);
Session queryByUserIdAndIp(@Param("userId") int userId,@Param("ip") String ip);
}

6
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/SessionMapper.xml

@ -6,4 +6,10 @@
from t_ds_session
where user_id = #{userId}
</select>
<select id="queryByUserIdAndIp" resultType="org.apache.dolphinscheduler.dao.entity.Session">
select *
from t_ds_session
where user_id = #{userId} AND ip = #{ip}
</select>
</mapper>
Loading…
Cancel
Save