Skip to content

Commit

Permalink
Regular check and close rsync deamon
Browse files Browse the repository at this point in the history
  • Loading branch information
CatKang committed Nov 14, 2016
1 parent b1ee52f commit 9efa86b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 1 addition & 3 deletions include/pika_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ class PikaServer
void Exit() {
exit_ = true;
}
void DoTimingTask() {
AutoPurge();
}
void DoTimingTask();
void Cleanup();

PikaSlavepingThread* ping_thread_;
Expand Down
13 changes: 13 additions & 0 deletions src/pika_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1142,3 +1142,16 @@ uint64_t PikaServer::ServerCurrentQps() {
return server_current_qps;
}

void PikaServer::DoTimingTask() {
// Purge log
AutoPurge();

// Check rsync deamon
if (((role_ & PIKA_ROLE_SLAVE) ^ PIKA_ROLE_SLAVE) || // Not a slave
repl_state_ == PIKA_REPL_NO_CONNECT ||
repl_state_ == PIKA_REPL_CONNECTED ||
repl_state_ == PIKA_REPL_ERROR) {
slash::StopRsync(g_pika_conf->db_sync_path());
}
}

0 comments on commit 9efa86b

Please sign in to comment.