Skip to content

Commit

Permalink
tools: adding signal handling for immutable obj cache daemon
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Zhou <[email protected]>
  • Loading branch information
zhouyuan committed Mar 21, 2019
1 parent cd836e9 commit 97991f6
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/tools/immutable_object_cache/CacheController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,24 @@ int CacheController::init() {
int CacheController::shutdown() {
ldout(m_cct, 20) << dendl;

int r = m_object_cache_store->shutdown();
int r = m_cache_server->stop();
if (r < 0) {
lderr(m_cct) << "stop error\n" << dendl;
return r;
}

r = m_object_cache_store->shutdown();
if (r < 0) {
lderr(m_cct) << "stop error\n" << dendl;
return r;
}

return r;
}

void CacheController::handle_signal(int signum){}
void CacheController::handle_signal(int signum) {
shutdown();
}

void CacheController::run() {
try {
Expand Down

0 comments on commit 97991f6

Please sign in to comment.