[Rpm-maint] [rpm-software-management/rpm] Vacuum the sqlite rpmdb if necessary (PR #3452)
Panu Matilainen
notifications at github.com
Tue Nov 19 12:19:10 UTC 2024
@pmatilai commented on this pull request.
> sqlexec(sdb, "PRAGMA optimize");
sqlexec(sdb, "PRAGMA wal_checkpoint = TRUNCATE");
+
+ int max_size = rpmExpandNumeric("%{?_sqlite_vacuum_kb}");
+ if (max_size <= 0)
+ max_size = 20*1024;
+ int64_t free_space = sqlite_free_space(sdb) >> 10;
+
+ if (free_space > max_size) {
+ sqlexec(sdb, "VACUUM");
+ rpmlog(RPMLOG_DEBUG, "rpmdb sqlite backend VACUUM maxfree: %ikB, free: %" PRIu64 "kB -> %" PRIu64 "kB\n", max_size, free_space, sqlite_free_space(sdb));
Oh and just spotted this now: please keep lines < 80 chacters to keep things readable in 80x terminal.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3452#pullrequestreview-2445244505
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/3452/review/2445244505 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20241119/fa57952f/attachment.htm>
More information about the Rpm-maint
mailing list