(internal): wrap db updates in a sql transaction (#862)

This will ensure atomicity with updates and should stop any partial updates that may occur.
This commit is contained in:
Tim Quelch
2020-06-24 15:30:44 +10:00
committed by GitHub
parent 220f395c1f
commit c59d6c4f7c

View File

@ -427,12 +427,13 @@ connections, nil is returned."
(current-buffer))))
(with-current-buffer buf
(save-excursion
(org-roam-db--update-meta)
(org-roam-db--update-tags)
(org-roam-db--update-titles)
(org-roam-db--update-refs)
(org-roam-db--update-headlines)
(org-roam-db--update-links)
(emacsql-with-transaction (org-roam-db--get-connection)
(org-roam-db--update-meta)
(org-roam-db--update-tags)
(org-roam-db--update-titles)
(org-roam-db--update-refs)
(org-roam-db--update-headlines)
(org-roam-db--update-links))
(org-roam-buffer--update-maybe :redisplay t))))))
(defun org-roam-db-build-cache (&optional force)