| 70 | } |
| 71 | |
| 72 | static bool test_expire(acl::redis& cmd, int n) |
| 73 | { |
| 74 | acl::string key; |
| 75 | |
| 76 | for (int i = 0; i < n; i++) |
| 77 | { |
| 78 | key.format("%s_%d", __keypre.c_str(), i); |
| 79 | cmd.clear(); |
| 80 | if (cmd.expire(key.c_str(), 100) < 0) |
| 81 | { |
| 82 | printf("expire key: %s error: %s\r\n", key.c_str(), |
| 83 | cmd.result_error()); |
| 84 | return false; |
| 85 | } |
| 86 | else if (i < 10) |
| 87 | printf("expire ok, key: %s\r\n", key.c_str()); |
| 88 | } |
| 89 | |
| 90 | return true; |
| 91 | } |
| 92 | |
| 93 | static bool test_ttl(acl::redis& cmd, int n) |
| 94 | { |