MCPcopy Create free account
hub / github.com/apache/brpc / RemoveRedisServer

Function RemoveRedisServer

test/brpc_redis_unittest.cpp:47–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45static pid_t g_redis_pid = -1;
46
47static 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"

Callers

nothing calls this directly

Calls 1

snprintfFunction · 0.85

Tested by

no test coverage detected