mirror of
https://github.com/xcat2/confluent.git
synced 2025-10-24 16:05:49 +00:00
Improve performance of creating new configmanager objects
Previously, the null tenant always synced to disk on every request in pracitice. Correct that mistake to avoid commit to disk when no changes are being made.
This commit is contained in:
@@ -414,12 +414,14 @@ class ConfigManager(object):
|
||||
self.tenant = None
|
||||
if 'main' not in _cfgstore:
|
||||
_cfgstore['main'] = {}
|
||||
self._bg_sync_to_file()
|
||||
self._cfgstore = _cfgstore['main']
|
||||
if 'groups' not in self._cfgstore:
|
||||
self._cfgstore['groups'] = {'everything': {'nodes': set()}}
|
||||
self._bg_sync_to_file()
|
||||
if 'nodes' not in self._cfgstore:
|
||||
self._cfgstore['nodes'] = {}
|
||||
self._bg_sync_to_file()
|
||||
self._bg_sync_to_file()
|
||||
return
|
||||
elif 'tenant' not in _cfgstore:
|
||||
_cfgstore['tenant'] = {tenant: {}}
|
||||
|
||||
Reference in New Issue
Block a user