PackageKit: specify a cache-age otherwise it is infinite by default#23087
Draft
MatMaul wants to merge 1 commit intocockpit-project:mainfrom
Draft
PackageKit: specify a cache-age otherwise it is infinite by default#23087MatMaul wants to merge 1 commit intocockpit-project:mainfrom
MatMaul wants to merge 1 commit intocockpit-project:mainfrom
Conversation
MatMaul
commented
Apr 2, 2026
| debug("constructing packagekit"); | ||
| package_manager = new PackageKitManager(); | ||
| let pk_manager = new PackageKitManager(); | ||
| await pk_manager.init(); |
Author
There was a problem hiding this comment.
We may want to add an init method directly on the PackageManager interface instead of doing what I did here. We can't do that in the constructor since we need an async context.
Member
|
Not sure if this will work as diff --git a/pkg/lib/packagekit.js b/pkg/lib/packagekit.js
index 6b2061124..8821a7a1f 100644
--- a/pkg/lib/packagekit.js
+++ b/pkg/lib/packagekit.js
@@ -186,6 +186,9 @@ export function transaction(method, arglist, signalHandlers, notifyHandler) {
const watchPromise = watchTransaction(transactionPath, signalHandlers, notifyHandler) || Promise.resolve();
return watchPromise.then(() => {
+ // FIX: force set cache to 24h as some PK backends like dnf4 doesn't
+ // integrate with PK cache and shows cache as 0.
+ call(transactionPath, transactionInterface, "SetHints", ["cache-age=86400"]);
if (method) {
return call(transactionPath, transactionInterface, method, arglist)
.then(() => transactionPath); |
Author
|
Indeed good catch thanks. I've build some rpm for my server and I'll be able to test it on next available updates. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completely untested because I don't have a dev env to test but something like that should be enough to fix #23086 I believe.