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

subversion at boxbackup.org subversion at boxbackup.org
Thu Apr 17 21:57:33 BST 2014


Author: chris
Date: 2014-04-17 21:57:33 +0100 (Thu, 17 Apr 2014)
New Revision: 3335

Modified:
   box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp
Log:
Call RunBackgroundTask while scanning directories as well.

Enables bbackupd to be stopped, reloaded or status queried while scanning
a large directory.

Modified: box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp
===================================================================
--- box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp	2014-04-17 20:57:25 UTC (rev 3334)
+++ box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp	2014-04-17 20:57:33 UTC (rev 3335)
@@ -303,10 +303,19 @@
 			struct dirent *en = 0;
 			EMU_STRUCT_STAT file_st;
 			std::string filename;
+			int num_entries_found = 0;
+
 			while((en = ::readdir(dirHandle)) != 0)
 			{
+				num_entries_found++;
 				rParams.mrContext.DoKeepAlive();
-				
+				if(rParams.mpBackgroundTask)
+				{
+					rParams.mpBackgroundTask->RunBackgroundTask(
+						BackgroundTask::Scanning_Dirs,
+						num_entries_found, 0);
+				}
+
 				// Don't need to use
 				// LinuxWorkaround_FinishDirentStruct(en,
 				// rLocalPath.c_str());




More information about the Boxbackup-commit mailing list