Merge "Require that updater_workers be a postive integer"

This commit is contained in:
Zuul 2024-12-20 00:23:16 +00:00 committed by Gerrit Code Review
commit 78fd4e6bfa
2 changed files with 4 additions and 1 deletions

View File

@ -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 '

View File

@ -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'})