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 2022-02-19 15:44:21 -05:00
parent 2b7a5ff035
commit 888fb58c4f
1 changed files with 2 additions and 1 deletions

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: