database: sync namespace bugfix

Use the transaction object to overwrite keys so that we don't
move the cursor.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan committed 2022-02-22 07:47:38 -05:00
1 parent 2b7a5ff035
commit 888fb58c4f
1 file changed
+2 -1
+2 -1
View File
@@ -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: