办学质量监测教学评价系统
ageer
2025-05-11 84b8d6f675c2f3aed83e0503e79cf1fa05e888e5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package org.ruoyi.common.chat.config;
 
import cn.hutool.cache.CacheUtil;
import cn.hutool.cache.impl.TimedCache;
import cn.hutool.core.date.DateUnit;
import lombok.extern.slf4j.Slf4j;
 
/**
 *
 * @author https:www.unfbx.com
 * @date 2023-03-10
 */
@Slf4j
public class LocalCache {
    /**
     * 缓存时长
     */
    public static final long TIMEOUT = 30 * DateUnit.MINUTE.getMillis();
    /**
     * 清理间隔
     */
    private static final long CLEAN_TIMEOUT = 30 * DateUnit.MINUTE.getMillis();
 
    /**
     * 缓存对象
     */
    public static final TimedCache<String, Object> CACHE = CacheUtil.newTimedCache(TIMEOUT);
 
 
    static {
        //启动定时任务
        CACHE.schedulePrune(CLEAN_TIMEOUT);
    }
 
}