Skip to content

Commit

Permalink
Fix order of cache operations to match description in man page.
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlopezroche committed Nov 6, 2022
1 parent ab5ef95 commit 2afce5e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions fdupes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1442,6 +1442,9 @@ void close_db_on_exit()
if (!sqlite3_get_autocommit(db))
hashdb_committransaction(db);

if (ISFLAG(flags, F_VACUUMCACHE) && !got_sigint)
hashdb_vacuum(db);

hashdb_close(db);

db = 0;
Expand Down Expand Up @@ -1765,13 +1768,6 @@ int main(int argc, char **argv) {
hashdb_foreachdirectory(db, 0, delist_directory_if_missing);
hashdb_foreachhash(db, 0, delist_hash_if_orphaned);
}

if (ISFLAG(flags, F_VACUUMCACHE)) {
hashdb_committransaction(db);
hashdb_vacuum(db);

hashdb_begintransaction(db);
}
}
#endif

Expand Down

0 comments on commit 2afce5e

Please sign in to comment.