Merge "Require that updater_workers be a postive integer"
This commit is contained in:
2 changed files with 4 additions and 1 deletions
@@ -427,7 +427,8 @@ class ObjectUpdater(Daemon):
self.interval = float(conf.get('interval', 300))
self.container_ring = None
self.concurrency = int(conf.get('concurrency', 8))
self.updater_workers = int(conf.get('updater_workers', 1))
self.updater_workers = config_positive_int_value(
conf.get('updater_workers', 1))
if 'slowdown' in conf:
self.logger.warning(
'The slowdown option is deprecated in favor of '
@@ -185,6 +185,8 @@ class TestObjectUpdater(unittest.TestCase):
check_bad({'interval': 'foo'})
check_bad({'concurrency': 'bar'})
check_bad({'concurrency': '1.0'})
check_bad({'updater_workers': '0'})
check_bad({'updater_workers': '-1'})
check_bad({'slowdown': 'baz'})
check_bad({'objects_per_second': 'quux'})
check_bad({'max_objects_per_container_per_second': '-0.1'})
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.