New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add API for asking whether the pool is empty #466
base: master
Are you sure you want to change the base?
Conversation
64a2022
to
a66c038
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite a few changes needed.
AsCache should expose a more low-level API, so returning a component-count makes a lot of sense here, as we will probably want to have that value returned by the pool anyway as well (so a software center can also refresh if the amount of components looks suspiciously low). but the is_empty function can be built upon that.
Also, so _get_ prefix is needed for _is_*-style functions.
The way emptyness is determined is super inefficient here, but if you want to I could fix that up for you in a follow-up commit once this PR is merged (at the moment we deserialize all data and then throw it away just to determine the amount of stuff in the cache, so we at least need to stop doing that. But there's even more efficient methods to do determine the amount of cache entries).
fddd8de
to
4778a50
Compare
On certain systems a refresh is necessary in such cases and, in any case, it's useful to know whether queries are pointless.
a1a5ebc
to
c8de370
Compare
On certain systems a refresh is necessary in such cases and, in any case, it's useful to know whether queries are pointless.
I wonder if it would make sense to be more specific about what we are looking up, since I guess it could be getting confused by fwupd or flatpak...