diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-04-17 20:57:33 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-04-17 20:57:33 +0000 |
commit | 1ef44d9922592ca8486fbbb866e971c94666c747 (patch) | |
tree | 3cf63e1f543f1c75a2db4443865da2813952dbc4 | |
parent | eb919cbed2812b1664b9759327d3b2623522f289 (diff) |
Call RunBackgroundTask while scanning directories as well.
Enables bbackupd to be stopped, reloaded or status queried while scanning
a large directory.
-rw-r--r-- | bin/bbackupd/BackupClientDirectoryRecord.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bin/bbackupd/BackupClientDirectoryRecord.cpp b/bin/bbackupd/BackupClientDirectoryRecord.cpp index 43e72be8..c8b95982 100644 --- a/bin/bbackupd/BackupClientDirectoryRecord.cpp +++ b/bin/bbackupd/BackupClientDirectoryRecord.cpp @@ -303,10 +303,19 @@ void BackupClientDirectoryRecord::SyncDirectory( 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()); |