From 42bdb42573e1578b6327ac53fc466aa15216a8c6 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Sun, 13 Jun 2021 11:03:52 -0400 Subject: [PATCH] database: read out all namespaces on init If a namespace contains an invalid key reading out the namespace should correct the issue. Signed-off-by: Eric Callahan --- moonraker/components/database.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/moonraker/components/database.py b/moonraker/components/database.py index f2f8496..08036aa 100644 --- a/moonraker/components/database.py +++ b/moonraker/components/database.py @@ -89,6 +89,9 @@ class MoonrakerDatabase: txn.put(b'database_version', self._encode_value(DATABASE_VERSION), db=mrdb) + # Read out all namespaces to remove any invalid keys on init + for ns in self.namespaces.keys(): + self._get_namespace(ns) # Protected Namespaces have read-only API access. Write access can # be granted by enabling the debug option. Forbidden namespaces # have no API access. This cannot be overridden.