mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-15 04:13:42 +00:00
enhance: make shared tool cache safe at any capacity (#1401)
Co-authored-by: bircni <[email protected]>
This commit is contained in:
1 parent
84c0fcd1fa
commit
a021d3139d
9 files changed
+121
-11
No files matched your search
@@ -79,6 +79,7 @@ type Runner struct {
|
||||
runningTasks sync.Map
|
||||
runningCount atomic.Int64
|
||||
lastIdleCleanupUnixNano atomic.Int64
|
||||
slots slotAllocator
|
||||
now func() time.Time
|
||||
healthCheckLast time.Time
|
||||
healthCheckReady bool
|
||||
@@ -451,6 +452,9 @@ func (r *Runner) run(ctx context.Context, task *runnerv1.Task, reporter *report.
|
||||
}
|
||||
}()
|
||||
|
||||
slot := r.slots.acquire()
|
||||
defer r.slots.release(slot)
|
||||
|
||||
workflowCallInputs := restoreCalledWorkflowContext(task)
|
||||
for _, line := range r.setupLines(task) {
|
||||
reporter.Logf("%s", line)
|
||||
@@ -623,6 +627,7 @@ func (r *Runner) run(ctx context.Context, task *runnerv1.Task, reporter *report.
|
||||
ValidVolumes: r.cfg.Container.ValidVolumes,
|
||||
ContainerVolumes: r.cfg.Container.Volumes,
|
||||
SharedToolCache: r.cfg.Runner.ToolCacheMode == config.ToolCacheModeShared,
|
||||
ToolCacheSlot: toolCacheSlot(r.cfg.Runner.ToolCacheMode, slot),
|
||||
InsecureSkipTLS: r.cfg.Runner.Insecure,
|
||||
ClientCertFile: r.cfg.Runner.ClientCertFile,
|
||||
ClientKeyFile: r.cfg.Runner.ClientKeyFile,
|
||||
|
||||
Reference in new issue
Block a user