[Box Backup-commit] COMMIT r3338 - box/trunk/bin/bbackupd

subversion at boxbackup.org subversion at boxbackup.org
Fri Apr 18 10:27:52 BST 2014


Author: chris
Date: 2014-04-18 10:27:52 +0100 (Fri, 18 Apr 2014)
New Revision: 3338

Modified:
   box/trunk/bin/bbackupd/BackupDaemon.cpp
Log:
Stop the CommandSocketPollTimer at end of each backup.

Otherwise it interrupts us needlessly while we're sleeping waiting for
the next backup.

Modified: box/trunk/bin/bbackupd/BackupDaemon.cpp
===================================================================
--- box/trunk/bin/bbackupd/BackupDaemon.cpp	2014-04-18 08:56:01 UTC (rev 3337)
+++ box/trunk/bin/bbackupd/BackupDaemon.cpp	2014-04-18 09:27:52 UTC (rev 3338)
@@ -202,8 +202,7 @@
 	  mpProgressNotifier(this),
 	  mpLocationResolver(this),
 	  mpRunStatusProvider(this),
-	  mpSysadminNotifier(this),
-	  mapCommandSocketPollTimer(NULL)
+	  mpSysadminNotifier(this)
 	#ifdef WIN32
 	, mInstallService(false),
 	  mRemoveService(false),
@@ -443,9 +442,6 @@
 	// 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 @@
 				"exception, ignored.");
 		}
 
-		mapCommandSocketPollTimer.reset();
 		Timers::Cleanup();
 		
 		throw;
@@ -501,7 +496,6 @@
 
 	// Clean up
 	mapCommandSocketInfo.reset();
-	mapCommandSocketPollTimer.reset();
 	Timers::Cleanup();
 }
 
@@ -1680,6 +1674,10 @@
 	// 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 @@
 		// 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 */);
 




More information about the Boxbackup-commit mailing list