worker: Add search job implementation to worker client

This is similar to the depsolve job, and it shares the solver (which
supports locking, as does DNF itself). This will allow searching for
specific package names, names with globs, or names as substrings of
other names using * as the wildcard.

Related: RHEL-60136
This commit is contained in:
Brian C. Lane 2025-01-24 09:29:45 -08:00 committed by Tomáš Hozza
parent 84c0f79286
commit d8df7e7cd4
4 changed files with 100 additions and 1 deletions

View file

@ -427,7 +427,7 @@ var run = func() {
}
}
// depsolve jobs can be done during other jobs
// depsolve and search jobs can be done during other jobs
depsolveCtx, depsolveCtxCancel := context.WithCancel(context.Background())
solver := dnfjson.NewBaseSolver(rpmmd_cache)
if config.DNFJson != "" {
@ -440,6 +440,10 @@ var run = func() {
Solver: solver,
RepositoryMTLSConfig: repositoryMTLSConfig,
},
worker.JobTypeSearchPackages: &SearchPackagesJobImpl{
Solver: solver,
RepositoryMTLSConfig: repositoryMTLSConfig,
},
}
acceptedJobTypes := []string{}
for jt := range jobImpls {