This commit is contained in:
张良(004796)
2024-05-10 16:42:32 +08:00
parent 0308919d04
commit ae0143d7bc
3 changed files with 5 additions and 3 deletions

View File

@@ -69,7 +69,7 @@ public class BusOp {
List<SysOperLog> list = sysOperLogMapper.selectList(Wrappers.lambdaUpdate(SysOperLog.class) List<SysOperLog> list = sysOperLogMapper.selectList(Wrappers.lambdaUpdate(SysOperLog.class)
.lt(SysOperLog::getOperTime, copyTimeFlag) .lt(SysOperLog::getOperTime, copyTimeFlag)
.last("limit 300")); .last("limit 300"));
if(current > 500 || CollectionUtils.isEmpty(list)){ if(current > 1000 || CollectionUtils.isEmpty(list)){
break; break;
} }
current++; current++;

View File

@@ -28,10 +28,11 @@ public class DynamicTotalCache {
return String.format(RedisHttpConstant.DYNAMIC_TOTAL_CACHE_REDIS,now,userId); return String.format(RedisHttpConstant.DYNAMIC_TOTAL_CACHE_REDIS,now,userId);
} }
public void add(Long userId){ public Long add(Long userId){
String key = getKey(userId); String key = getKey(userId);
redisTemplate.opsForValue().increment(key); Long increment = redisTemplate.opsForValue().increment(key);
redisTemplate.expire(key,1, TimeUnit.DAYS); redisTemplate.expire(key,1, TimeUnit.DAYS);
return increment;
} }
public int get(Long userId){ public int get(Long userId){

View File

@@ -160,6 +160,7 @@ public class DynamicServiceImpl extends ServiceImpl<DynamicMapper, Dynamic> impl
dynamicImages.add(po); dynamicImages.add(po);
} }
dynamicImagesService.saveBatch(dynamicImages); dynamicImagesService.saveBatch(dynamicImages);
dynamicTotalCache.add(dynamic.getUserId());
} }
} }