| 45 | static pid_t g_redis_pid = -1; |
| 46 | |
| 47 | static void RemoveRedisServer() { |
| 48 | if (g_redis_pid > 0) { |
| 49 | puts("[Stopping redis-server]"); |
| 50 | char cmd[256]; |
| 51 | #if defined(BAIDU_INTERNAL) |
| 52 | snprintf(cmd, sizeof(cmd), "kill %d; rm -rf redis_server_for_test", g_redis_pid); |
| 53 | #else |
| 54 | snprintf(cmd, sizeof(cmd), "kill %d", g_redis_pid); |
| 55 | #endif |
| 56 | CHECK(0 == system(cmd)); |
| 57 | // Wait for redis to stop |
| 58 | usleep(50000); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | #define REDIS_SERVER_BIN "redis-server" |
| 63 | #define REDIS_SERVER_PORT "6479" |
nothing calls this directly
no test coverage detected