Commit 783e856e authored by Harald Sitter's avatar Harald Sitter 💣

disable ksyscoca rebuilding in appstream runner

same as 5a648c56 for the service runner.

Kservice internally will hold a KDirWatch instance through KSycoca and
that instance has an inotify instance. Since inotify instances have a
per-user limit we mustn't be wasteful with them. Since our runner
threads do not actually need automatic ksyscoca reloading (reloading
on-demand as we use ksyscoca is perfectly reasonable) we need to
explicitly disable this feature so the internal inotify instance can be
freed.

CCBUG: 423818
parent 63cb5505
......@@ -29,6 +29,7 @@
#include <KLocalizedString>
#include <KApplicationTrader>
#include <KSycoca>
#include "debug.h"
......@@ -86,6 +87,10 @@ void InstallerRunner::match(Plasma::RunnerContext &context)
if (component.kind() != AppStream::Component::KindDesktopApp)
continue;
// KApplicationTrader uses KService which uses KSycoca which holds
// KDirWatch instances to monitor changes. We don't need this on
// our runner threads - let's not needlessly allocate inotify instances.
KSycoca::disableAutoRebuild();
const QString componentId = component.id();
const auto servicesFound = KApplicationTrader::query([&componentId] (const KService::Ptr &service) {
if (service->exec().isEmpty())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment