mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-14 00:17:04 +00:00
test[orm]: EntityCache test
This commit is contained in:
1 parent
18531c09ef
commit
099492d186
2 files changed
+9
-6
No files matched your search
@@ -17,6 +17,7 @@ import com.mongodb.client.model.Filters;
|
||||
import com.zfoo.orm.OrmContext;
|
||||
import com.zfoo.orm.entity.UserEntity;
|
||||
import com.zfoo.protocol.util.ThreadUtils;
|
||||
import com.zfoo.scheduler.util.TimeUtils;
|
||||
import org.bson.Document;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
@@ -45,7 +46,9 @@ public class EntityCachesTest {
|
||||
userEntityCaches.update(entity);
|
||||
}
|
||||
|
||||
ThreadUtils.sleep(Long.MAX_VALUE);
|
||||
ThreadUtils.sleep(60 * TimeUtils.MILLIS_PER_SECOND);
|
||||
|
||||
userEntityCaches.load(1L);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,15 +27,15 @@
|
||||
|
||||
<!-- 缓存策略 -->
|
||||
<orm:caches>
|
||||
<orm:cache strategy="default" size="6000" expire-millisecond="600000"/>
|
||||
<orm:cache strategy="hundred" size="100" expire-millisecond="600000"/>
|
||||
<orm:cache strategy="thousand" size="1000" expire-millisecond="600000"/>
|
||||
<orm:cache strategy="threeThousand" size="3000" expire-millisecond="600000"/>
|
||||
<orm:cache strategy="default" size="6000" expire-millisecond="60000"/>
|
||||
<orm:cache strategy="hundred" size="100" expire-millisecond="60000"/>
|
||||
<orm:cache strategy="thousand" size="1000" expire-millisecond="60000"/>
|
||||
<orm:cache strategy="threeThousand" size="3000" expire-millisecond="60000"/>
|
||||
</orm:caches>
|
||||
|
||||
<!-- 持久化策略 -->
|
||||
<orm:persisters>
|
||||
<orm:persister strategy="default" type="time" config="600000"/>
|
||||
<orm:persister strategy="default" type="time" config="30000"/>
|
||||
<orm:persister strategy="cron30s" type="cron" config="0/30 * * * * ?"/>
|
||||
<orm:persister strategy="time30s" type="time" config="30000"/>
|
||||
</orm:persisters>
|
||||
|
||||
Reference in new issue
Block a user