| 54 | } |
| 55 | |
| 56 | static bool test_ttl(acl::redis_key& redis, int i) |
| 57 | { |
| 58 | acl::string key; |
| 59 | int ttl; |
| 60 | |
| 61 | key.format("%s_%d", __keypre.c_str(), i); |
| 62 | redis.clear(); |
| 63 | if ((ttl = redis.ttl(key.c_str())) < 0) |
| 64 | { |
| 65 | printf("get ttl key: %s error\r\n", key.c_str()); |
| 66 | return false; |
| 67 | } |
| 68 | else if (i < 10) |
| 69 | printf("ttl ok, key: %s, ttl: %d\r\n", key.c_str(), ttl); |
| 70 | return true; |
| 71 | } |
| 72 | |
| 73 | static bool test_exists(acl::redis_key& redis, int i) |
| 74 | { |