Remove completed jobs and slight optimization
* Removes completed jobs from the db * Skip ensure min idle runners for pools with min idle runners set to 0 Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
5153738359
commit
b6a02db446
1 changed files with 6 additions and 1 deletions
|
|
@ -956,9 +956,10 @@ func (r *basePoolManager) addRunnerToPool(pool params.Pool) error {
|
|||
}
|
||||
|
||||
func (r *basePoolManager) ensureIdleRunnersForOnePool(pool params.Pool) error {
|
||||
if !pool.Enabled {
|
||||
if !pool.Enabled || pool.MinIdleRunners == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
existingInstances, err := r.store.ListPoolInstances(r.ctx, pool.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to ensure minimum idle workers for pool %s: %w", pool.ID, err)
|
||||
|
|
@ -1514,5 +1515,9 @@ func (r *basePoolManager) consumeQueuedJobs() error {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if err := r.store.DeleteCompletedJobs(r.ctx); err != nil {
|
||||
log.Printf("failed to delete completed jobs: %q", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue