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

Panu Matilainen notifications at github.com
Tue Nov 19 12:18:41 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;

int64_t here doesn't help when it's long in sqlite_free_space(). Which should return the same kind of data as the macro really so this calculation belongs to that function, more like. Doing *1024 but then >> 10 looks super confusing, lets just stick to basic maths for doing math, because to me a bitshift suggests there's something more special going on.

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

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


More information about the Rpm-maint mailing list