diff options
author | Lars Wirzenius <liw@liw.fi> | 2016-10-18 08:50:03 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2016-10-18 08:50:03 +0300 |
commit | 948d4d913885787f0b0e9e700a14ba2d70e1d063 (patch) | |
tree | 9c5981a087a2d82ddfe4cbec708712643e589d56 | |
parent | 522af1c6eb2c342f2e207c19e58e0a942920d129 (diff) | |
download | obnam-948d4d913885787f0b0e9e700a14ba2d70e1d063.tar.gz |
Be less hardcoded about dir count
-rw-r--r-- | obnamlib/plugins/backup_plugin.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/obnamlib/plugins/backup_plugin.py b/obnamlib/plugins/backup_plugin.py index b4692162..435ca67e 100644 --- a/obnamlib/plugins/backup_plugin.py +++ b/obnamlib/plugins/backup_plugin.py @@ -388,7 +388,10 @@ class BackupPlugin(obnamlib.ObnamPlugin): self.root_metadata = self.fs.lstat(absroot) num_dirs = 0 - flush_threshold = 1000 + # The following is a very approximate guess, but we have no + # way of being exact. + dir_enry_size = 1000 + flush_threshold = obnamlib.DEFAULT_DIR_BAG_BYTES / dir_entry_size for pathname, metadata in self.find_files(absroot): logging.info('Backing up %s', pathname) |