[dev] update front-end page(all date string generate by server)

This commit is contained in:
tjq 2020-07-19 23:21:09 +08:00
parent 987c016e24
commit 7a6b8c0a0c
8 changed files with 35 additions and 8 deletions

View File

@ -68,7 +68,7 @@ PS感谢文档翻译平台[breword](https://www.breword.com/)对本项目英
* [广播执行](https://yq.aliyun.com/articles/716203?spm=a2c4e.11153959.teamhomeleft.40.371960c9qhB1mB)运行清理日志脚本什么的也太实用了8
# 其他
* 产品永久开源Apache License, Version 2.0),免费使用,且目前开发者@KFCFans有充足的时间进行项目维护和提供无偿技术支持All In 了解一下),欢迎各位试用!
* 开源许可证Apache License, Version 2.0
* 欢迎共同参与本项目的贡献PR和Issue都大大滴欢迎求求了
* 觉得还不错的话可以点个Star支持一下哦 = ̄ω ̄=
* 联系方式@KFCFans -> `tengjiqi@gmail.com`

View File

@ -7,7 +7,7 @@ import lombok.extern.slf4j.Slf4j;
/**
* 处理 server 异常信息的 actor
*
* @author 朱八
* @author tjq
* @since 2020/7/18
*/
@Slf4j

View File

@ -64,7 +64,7 @@ public interface InstanceInfoRepository extends JpaRepository<InstanceInfoDO, Lo
long countByAppIdAndStatus(long appId, int status);
long countByAppIdAndStatusAndGmtCreateAfter(long appId, int status, Date time);
@Query(value = "select jobId from InstanceInfoDO where jobId in ?1 and status in ?2")
@Query(value = "select distinct jobId from InstanceInfoDO where jobId in ?1 and status in ?2")
List<Long> findByJobIdInAndStatusIn(List<Long> jobIds, List<Integer> status);
// 删除历史数据JPA自带的删除居然是根据ID循环删2000条数据删了几秒也太拉垮了吧...

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -9,6 +9,7 @@ import com.github.kfcfans.powerjob.server.persistence.core.model.OmsLockDO;
import com.github.kfcfans.powerjob.server.persistence.core.repository.InstanceInfoRepository;
import com.github.kfcfans.powerjob.server.persistence.core.repository.JobInfoRepository;
import com.github.kfcfans.powerjob.server.persistence.core.repository.OmsLockRepository;
import com.github.kfcfans.powerjob.server.persistence.core.repository.WorkflowInstanceInfoRepository;
import org.assertj.core.util.Lists;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -37,6 +38,8 @@ public class RepositoryTest {
private OmsLockRepository omsLockRepository;
@Resource
private InstanceInfoRepository instanceInfoRepository;
@Resource
private WorkflowInstanceInfoRepository workflowInstanceInfoRepository;
/**
* 需要证明批量写入失败后会回滚
@ -54,6 +57,14 @@ public class RepositoryTest {
omsLockRepository.flush();
}
@Test
public void testDeleteLock() {
String lockName = "test-lock";
OmsLockDO lockDO = new OmsLockDO(lockName, NetUtils.getLocalHost(), 10000L);
omsLockRepository.save(lockDO);
omsLockRepository.deleteByLockName(lockName);
}
@Test
public void testSelectCronJobSQL() {
List<JobInfoDO> result = jobInfoRepository.findByAppIdInAndStatusAndTimeExpressionTypeAndNextTriggerTimeLessThanEqual(Lists.newArrayList(1L), SwitchableStatus.ENABLE.getV(), TimeExpressionType.CRON.getV(), System.currentTimeMillis());
@ -85,4 +96,20 @@ public class RepositoryTest {
System.out.println(res);
}
@Test
public void testFindByJobIdInAndStatusIn() {
List<Long> res = instanceInfoRepository.findByJobIdInAndStatusIn(Lists.newArrayList(1L, 2L, 3L, 4L), Lists.newArrayList(1, 2, 3, 4, 5));
System.out.println(res);
}
@Test
public void testDeleteInstanceInfo() {
instanceInfoRepository.deleteAllByGmtModifiedBefore(new Date());
}
@Test
public void testDeleteWorkflowInstanceInfo() {
workflowInstanceInfoRepository.deleteAllByGmtModifiedBefore(new Date());
}
}

View File

@ -1,4 +1,4 @@
server.port=8082
server.port=8081
spring.jpa.open-in-view=false