core: Replace legacy INI config system with Pydantic-based TOML configuration.
This is a huge configuration refactoring. The configuration system now uses Pydantic settings, with better validation, better support for environment variables and other goodies. The main config files now use TOML instead of INI, this allow for better handling of complex types, notably dict. Plugins, components and frontends can declare their config settings in a class which will be imported dynamically.
This commit is contained in:
parent
f3f40848b3
commit
6a7b7bc36a
1 changed files with 1392 additions and 1011 deletions
|
|
@ -16,6 +16,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from libervia.backend import G
|
||||
from libervia.backend.core.i18n import _
|
||||
from libervia.backend.core.constants import Const as C
|
||||
from libervia.backend.core import exceptions
|
||||
|
|
@ -137,13 +138,7 @@ class XEP_0198(object):
|
|||
host.trigger.add("xml_init", self._xml_init_trigger)
|
||||
host.trigger.add("disconnecting", self._disconnecting_trigger)
|
||||
host.trigger.add("disconnected", self._disconnected_trigger)
|
||||
try:
|
||||
self._ack_timeout = int(
|
||||
host.memory.config_get("", "ack_timeout", ACK_TIMEOUT)
|
||||
)
|
||||
except ValueError:
|
||||
log.error(_("Invalid ack_timeout value, please check your configuration"))
|
||||
self._ack_timeout = ACK_TIMEOUT
|
||||
self._ack_timeout = G.config.common.ack_timeout
|
||||
if not self._ack_timeout:
|
||||
log.info(_("Ack timeout disabled"))
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue