summaryrefslogtreecommitdiff
path: root/bin/bbackupd/BackupDaemon.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-04-18 09:27:52 +0000
committerChris Wilson <chris+github@qwirx.com>2014-04-18 09:27:52 +0000
commitcd0c016f77eadea08c222b4774e590c387163f97 (patch)
treed6d89a700a8e50491bee93a515886b20e80bc728 /bin/bbackupd/BackupDaemon.cpp
parent468296533343bbeed92864513012f7f4371aefb7 (diff)
Stop the CommandSocketPollTimer at end of each backup.
Otherwise it interrupts us needlessly while we're sleeping waiting for the next backup.
Diffstat (limited to 'bin/bbackupd/BackupDaemon.cpp')
-rw-r--r--bin/bbackupd/BackupDaemon.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp
index 893b12fb..88518ae2 100644
--- a/bin/bbackupd/BackupDaemon.cpp
+++ b/bin/bbackupd/BackupDaemon.cpp
@@ -202,8 +202,7 @@ BackupDaemon::BackupDaemon()
mpProgressNotifier(this),
mpLocationResolver(this),
mpRunStatusProvider(this),
- mpSysadminNotifier(this),
- mapCommandSocketPollTimer(NULL)
+ mpSysadminNotifier(this)
#ifdef WIN32
, mInstallService(false),
mRemoveService(false),
@@ -443,9 +442,6 @@ void BackupDaemon::Run()
// initialise global timer mechanism
Timers::Init();
- mapCommandSocketPollTimer.reset(new Timer(COMMAND_SOCKET_POLL_INTERVAL,
- "CommandSocketPollTimer"));
-
#ifndef WIN32
// Ignore SIGPIPE so that if a command connection is broken,
// the daemon doesn't terminate.
@@ -493,7 +489,6 @@ void BackupDaemon::Run()
"exception, ignored.");
}
- mapCommandSocketPollTimer.reset();
Timers::Cleanup();
throw;
@@ -501,7 +496,6 @@ void BackupDaemon::Run()
// Clean up
mapCommandSocketInfo.reset();
- mapCommandSocketPollTimer.reset();
Timers::Cleanup();
}
@@ -1680,6 +1674,10 @@ void BackupDaemon::OnBackupStart()
// Notify administrator
NotifySysadmin(SysadminNotifier::BackupStart);
+ // Setup timer for polling the command socket
+ mapCommandSocketPollTimer.reset(new Timer(COMMAND_SOCKET_POLL_INTERVAL,
+ "CommandSocketPollTimer"));
+
// Set state and log start
SetState(State_Connected);
BOX_NOTICE("Beginning scan of local files");
@@ -1708,6 +1706,10 @@ void BackupDaemon::OnBackupFinish()
// Notify administrator
NotifySysadmin(SysadminNotifier::BackupFinish);
+ // Stop the timer for polling the command socket,
+ // to prevent needless alarms while sleeping.
+ mapCommandSocketPollTimer.reset();
+
// Tell anything connected to the command socket
SendSyncStartOrFinish(false /* finish */);