提交 7a43f51a authored 作者: zjm's avatar zjm

合并分支 'master' 到 'dev'

Master to dev 查看合并请求 !36
......@@ -3,7 +3,6 @@ package com.tykj.dev.device.library.service;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import java.util.List;
import java.util.Map;
/**
* DATE:2021-8-11
......@@ -24,4 +23,7 @@ public interface DeviceLibraryCacheService {
*/
List<DeviceLibrary> findByIds(List<Integer> ids);
void deletAllDeviceLibraryList();
}
......@@ -3,9 +3,10 @@ package com.tykj.dev.device.library.service.impl;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import jdk.nashorn.internal.ir.IfNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
......@@ -55,4 +56,12 @@ public class CacheLibraryServiceImpl implements DeviceLibraryCacheService {
);
return libraryList;
}
@Override
@CacheEvict(key = "'device'",allEntries=true)
public void deletAllDeviceLibraryList() {
// long l = System.currentTimeMillis();
// List<DeviceLibrary> all = deviceLibraryDao.findAll();
// System.out.println("更新缓存时间"+(System.currentTimeMillis()-l));
}
}
......@@ -22,6 +22,7 @@ public class DevideTask {
@Scheduled(cron = "30 * * * * ? ")
private void signUpDeadline() {
log.info("定时device更新缓存开始");
deviceLibraryCacheService.deletAllDeviceLibraryList();
deviceLibraryCacheService.getAllDeviceLibraryList();
log.info("定时device更新缓存结束");
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论