提交 ecaae42d 编写于 作者: minghao.wu's avatar minghao.wu

fix: 修改接口为异步

上级 e1814163
流水线 #37943 已取消 于阶段
......@@ -99,20 +99,22 @@ public class TokenServiceImpl implements TokenService {
@Override
public void removeToken(Long timestamp) {
try {
Date lastLoginTime = new Date(timestamp);
for (Integer fromDoctorId = 0; fromDoctorId < 1000412091; fromDoctorId += 10000) {
List<Integer> doctorIdList = doctorMapper.selectIdByParams(fromDoctorId, fromDoctorId + 10000, lastLoginTime);
if (CollectionUtils.isEmpty(doctorIdList)) {
Thread.sleep(2000);
continue;
new Thread(() -> {
try {
Date lastLoginTime = new Date(timestamp);
for (Integer fromDoctorId = 0; fromDoctorId < 1000412091; fromDoctorId += 10000) {
List<Integer> doctorIdList = doctorMapper.selectIdByParams(fromDoctorId, fromDoctorId + 10000, lastLoginTime);
if (CollectionUtils.isEmpty(doctorIdList)) {
Thread.sleep(2000);
continue;
}
removeTokenByDoctorIdList(doctorIdList);
logger.info("remove token: {} {}", fromDoctorId, doctorIdList.size());
}
} catch (Exception ex) {
// ingnore
}
removeTokenByDoctorIdList(doctorIdList);
logger.info("remove token: {} {}", fromDoctorId, doctorIdList.size());
}
} catch (Exception ex) {
// ingnore
}
});
}
private void removeTokenByDoctorIdList(List<Integer> doctorIdList) throws Exception {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册