首页v2-定时任务-定时清理空麦位房间

This commit is contained in:
khalil
2024-11-18 20:37:21 +08:00
parent 7696bd4639
commit db6b636c52
2 changed files with 50 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package com.accompany.scheduler.task;
import com.accompany.business.service.homeV2.HomeV2Service;
import com.accompany.core.enumeration.PartitionEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class HomeV2ListTask {
@Autowired
private HomeV2Service homeV2Service;
/**
* 缓存当前有效的表情JSON
*/
@Scheduled(cron = "0 */6 * * * ?")
public void cacheFaceJson() {
for (PartitionEnum partitionEnum : PartitionEnum.values()) {
homeV2Service.clearPartitionPoolSet(partitionEnum.getId());
}
}
}