Add a -max-list-rate option to backup to slow down the listing

This option sets the maximum number of files that can be listed in one
second.
This commit is contained in:
Gilbert Chen
2020-09-22 08:27:09 -04:00
parent 6ee01a2e74
commit 67a3103467
5 changed files with 31 additions and 12 deletions

View File

@@ -1396,7 +1396,7 @@ func (manager *SnapshotManager) Diff(top string, snapshotID string, revisions []
if len(revisions) <= 1 {
// Only scan the repository if filePath is not provided
if len(filePath) == 0 {
rightSnapshot, _, _, err = CreateSnapshotFromDirectory(snapshotID, top, nobackupFile, filtersFile)
rightSnapshot, _, _, err = CreateSnapshotFromDirectory(snapshotID, top, nobackupFile, filtersFile, 0)
if err != nil {
LOG_ERROR("SNAPSHOT_LIST", "Failed to list the directory %s: %v", top, err)
return false