From 888fb58c4fe94535d450286323a7e2fb42e3e84e Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Sat, 19 Feb 2022 15:44:21 -0500 Subject: [PATCH] database: sync namespace bugfix Use the transaction object to overwrite keys so that we don't move the cursor. Signed-off-by: Eric Callahan --- moonraker/components/database.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/moonraker/components/database.py b/moonraker/components/database.py index a3178ef..05803c7 100644 --- a/moonraker/components/database.py +++ b/moonraker/components/database.py @@ -500,7 +500,8 @@ class MoonrakerDatabase: else: decoded = self._decode_value(bval) if decoded != value[key]: - cursor.put(self._encode_value(value[key])) + new_val = self._encode_value(value[key]) + txn.put(key.encode(), new_val) new_keys.remove(key) remaining = cursor.next() for key in new_keys: