[Rpm-maint] [rpm-software-management/rpm] Vacuum the sqlite rpmdb if necessary (PR #3452)

Panu Matilainen notifications at github.com
Tue Nov 19 08:21:11 UTC 2024


@pmatilai commented on this pull request.



>  		sqlexec(sdb, "PRAGMA optimize");
 		sqlexec(sdb, "PRAGMA wal_checkpoint = TRUNCATE");
+
+		int max_size = rpmExpandNumeric("%{?_sqlite_vacuum}");
+		if (max_size <= 0)
+		    max_size = 20*1024*1024;
+		int64_t free_space = sqlite_free_space(sdb);
+
+		if (free_space > max_size) {
+		    sqlexec(sdb, "VACUUM");
+		    rpmlog(RPMLOG_DEBUG, "Rpmdb Sqlite backend VACUUM maxfree: %i, free: %" PRIu64 " -> %" PRIu64 "\n", max_size, free_space, sqlite_free_space(sdb));

It's just a debug message and all, but This Mixed case JUMPS at me a bit. VACUUM uppercase seems reasonable because its SQL but generally debug messages are all lowercase.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3452#pullrequestreview-2444686633
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/3452/review/2444686633 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20241119/9e8c5a17/attachment-0001.htm>


More information about the Rpm-maint mailing list