From 5e64b870f5e0cd6569fb13cdfc232ef536e323c3 Mon Sep 17 00:00:00 2001 From: Bram Schoenmakers Date: Wed, 4 Aug 2021 09:55:00 +0200 Subject: [PATCH] Force sync: close the database before removal A force resync of the database does not work in Windows (Cygwin): apply: Removing old name: Device or resource busy, /home/brschoen/.emacs.d/org-roam.db Therefore, close the connection first and then try to remove the database file. --- org-roam-db.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org-roam-db.el b/org-roam-db.el index ccb36a0363..0887232b59 100644 --- a/org-roam-db.el +++ b/org-roam-db.el @@ -479,8 +479,8 @@ If UPDATE-P is non-nil, first remove the file in the database." "Synchronize the cache state with the current Org files on-disk. If FORCE, force a rebuild of the cache from scratch." (interactive "P") - (when force (delete-file org-roam-db-location)) (org-roam-db--close) ;; Force a reconnect + (when force (delete-file org-roam-db-location)) (org-roam-db) ;; To initialize the database, no-op if already initialized (let* ((gc-cons-threshold org-roam-db-gc-threshold) (org-agenda-files nil)