From 69147089fa278f1225ae5fb29c87a59009dcc900 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 17 Nov 2012 19:59:51 +0000 Subject: Fix duplicate tagging of housekeeping messages. --- bin/bbstored/BBStoreDHousekeeping.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'bin/bbstored') diff --git a/bin/bbstored/BBStoreDHousekeeping.cpp b/bin/bbstored/BBStoreDHousekeeping.cpp index d0f83aed..96fa7c80 100644 --- a/bin/bbstored/BBStoreDHousekeeping.cpp +++ b/bin/bbstored/BBStoreDHousekeeping.cpp @@ -100,15 +100,23 @@ void BackupStoreDaemon::RunHousekeepingIfNeeded() { try { - // Tag log output to identify account - std::ostringstream tag; - tag << "hk/" << BOX_FORMAT_ACCOUNT(*i); - Logging::Tagger tagWithClientID(tag.str()); - - // Get the account root std::string rootDir; int discSet = 0; - mpAccounts->GetAccountRoot(*i, rootDir, discSet); + + { + // Tag log output to identify account + std::ostringstream tag; + tag << "hk/" << BOX_FORMAT_ACCOUNT(*i); + Logging::Tagger tagWithClientID(tag.str()); + + // Get the account root + mpAccounts->GetAccountRoot(*i, rootDir, discSet); + + // Reset tagging as HousekeepStoreAccount will + // do that itself, to avoid duplicate tagging. + // Happens automatically when tagWithClientID + // goes out of scope. + } // Do housekeeping on this account HousekeepStoreAccount housekeeping(*i, rootDir, -- cgit v1.2.3