informant
informant copied to clipboard
Informant causes pacman to hang for a few seconds
I'm not sure if this is supposed to happen, but when I run a pacman command, when it hits "Checking ArchLinux news", it hangs for a few seconds before moving on.
Thanks for using informant! What you describe is expected.
This is a side-effect of the included pacman hook. When it runs it needs to make a web request to https://archlinux.org/feeds/news (I don't cache this and it will run every time the hook is called). The time of this web request could be of varying speed depending on your internet connection.
I built the pacman hook as a feature so that I never had to remember to check the news, but if you dislike the time the hook takes to run it is possible to disable the hook. I tried to write a bit about this in the README - basically either placing an overriding hook in /etc/pacman.d/
touch /etc/pacman.d/hooks/informant.hook
or a symlink to /dev/null
ln -s /dev/null /etc/pacman.d/hooks/informant.hook
will disable the hook and you can continue to use informant as a standalone tool.
Yeah I knew about the hook. It's unfortunate it causes it to hang. I wonder if their's any way to speed it up.
I haven't come up with any ideas to make it faster. Some sort of caching could help with multiple calls to informant in a short time period, but it also depends on the response time of the archlinux news feed.
I'm open to ideas for improving it if you or anyone else has them, pull requests are welcome too.
I think caching it and periodically updating the cache would be a good idea.
Hey, you've got to respect data integrity! What would be acceptable imho would be to cache and only full fetch when there is an actual repository update.
Though there are also etags!
That's a good idea
Caching added in AUR version 0.2.0-1
.
Is there any more improvement that can be made here? At this point it seems the bottlenecks are out of informant
's control. Should this issue be closed?
If the HTTP lookup is taking time, it's not an informant issue.