repeat check - Andy-Shao/GearEE-Redis GitHub Wiki

Design

It base on RepeatCheck interface in Gear Projection.

Example

@Autowired
private RedisConnectionFactory connectFactory;
    
@Test
public void testRepeatCheck() throws InterruptedException {
    RedisRepeatCheck repeatCheck = new RedisRepeatCheck(connectFactory);
    boolean isRepeat = repeatCheck.isRepeat("GearEE-Redis:RepeatCheck:testRepeatCheck" , ExpireMode.MILISECONDS , 200);
    Assert.assertFalse(isRepeat);
    isRepeat = repeatCheck.isRepeat("GearEE-Redis:RepeatCheck:testRepeatCheck");
    Assert.assertTrue(isRepeat);
    TimeUnit.SECONDS.sleep(1);
}