Add cache worker

Add dedicated worker to maintain cache.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2025-05-07 08:01:36 +00:00
parent e49b35d3d0
commit d0c9462a5d
13 changed files with 355 additions and 208 deletions

View file

@ -1595,13 +1595,6 @@ func (r *basePoolManager) cleanupOrphanedRunners(runners []*github.Runner) error
}
func (r *basePoolManager) Start() error {
// load pools in cache
pools, err := r.store.ListEntityPools(r.ctx, r.entity)
if err != nil {
return fmt.Errorf("failed to list pools: %w", err)
}
cache.ReplaceEntityPools(r.entity.ID, pools)
initialToolUpdate := make(chan struct{}, 1)
go func() {
slog.Info("running initial tool update")