compact: unconditionally remove old wip database compact directory

In case previous notmuch compact has been interrupted there is old
work-in-progress database compact directory partially filled. Remove
it just before starting to fill the directory with new files.
This commit is contained in:
Tomi Ollila 2013-11-15 00:03:26 +02:00 committed by David Bremner
parent cb6cc296e2
commit 6452ae0fcb

View file

@ -922,6 +922,12 @@ notmuch_database_compact (const char *path,
goto DONE;
}
/* Unconditionally attempt to remove old work-in-progress database (if
* any). This is "protected" by database lock. If this fails due to write
* errors (etc), the following code will fail and provide error message.
*/
(void) rmtree (compact_xapian_path);
try {
NotmuchCompactor compactor (status_cb, closure);