Merge "Require that updater_workers be a postive integer"
This commit is contained in:
commit
78fd4e6bfa
@ -427,7 +427,8 @@ class ObjectUpdater(Daemon):
|
|||||||
self.interval = float(conf.get('interval', 300))
|
self.interval = float(conf.get('interval', 300))
|
||||||
self.container_ring = None
|
self.container_ring = None
|
||||||
self.concurrency = int(conf.get('concurrency', 8))
|
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:
|
if 'slowdown' in conf:
|
||||||
self.logger.warning(
|
self.logger.warning(
|
||||||
'The slowdown option is deprecated in favor of '
|
'The slowdown option is deprecated in favor of '
|
||||||
|
@ -185,6 +185,8 @@ class TestObjectUpdater(unittest.TestCase):
|
|||||||
check_bad({'interval': 'foo'})
|
check_bad({'interval': 'foo'})
|
||||||
check_bad({'concurrency': 'bar'})
|
check_bad({'concurrency': 'bar'})
|
||||||
check_bad({'concurrency': '1.0'})
|
check_bad({'concurrency': '1.0'})
|
||||||
|
check_bad({'updater_workers': '0'})
|
||||||
|
check_bad({'updater_workers': '-1'})
|
||||||
check_bad({'slowdown': 'baz'})
|
check_bad({'slowdown': 'baz'})
|
||||||
check_bad({'objects_per_second': 'quux'})
|
check_bad({'objects_per_second': 'quux'})
|
||||||
check_bad({'max_objects_per_container_per_second': '-0.1'})
|
check_bad({'max_objects_per_container_per_second': '-0.1'})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user