mapdb icon indicating copy to clipboard operation
mapdb copied to clipboard

Data in FileDB will not expired, so that the usage of disk space can't be limited

Open Authorlove opened this issue 4 years ago • 1 comments

Authorlove avatar Jul 27 '20 03:07 Authorlove

I have a similar issue. Even for memory DB expire does not work for 3.0.8:

@Test
    public void testExpiration() throws InterruptedException {
        HTreeMap<String, String> map = (HTreeMap<String, String>) DBMaker
//                .fileDB("map").fileDeleteAfterClose()
                .memoryDB()
                .make().hashMap("map")
                .expireAfterCreate(10)
                .createOrOpen();
        map.put("a", "b");
        Thread.sleep(4000);
        assertNull(map.get("a"));
        map.close();
    }

chenqi0805 avatar Mar 17 '21 16:03 chenqi0805