MCPcopy Index your code
hub / github.com/docker/cli / newReplicatedJobProgressUpdater

Function newReplicatedJobProgressUpdater

cli/command/service/progress/progress.go:574–586  ·  view source on GitHub ↗
(service swarm.Service, progressOut progress.Output)

Source from the content-addressed store, hash-verified

572}
573
574func newReplicatedJobProgressUpdater(service swarm.Service, progressOut progress.Output) *replicatedJobProgressUpdater {
575 concurrent := int(*service.Spec.Mode.ReplicatedJob.MaxConcurrent)
576 total := int(*service.Spec.Mode.ReplicatedJob.TotalCompletions)
577
578 return &replicatedJobProgressUpdater{
579 progressOut: progressOut,
580 concurrent: concurrent,
581 total: total,
582 jobIteration: service.JobStatus.JobIteration.Index,
583 progressDigits: len(strconv.Itoa(total)),
584 activeDigits: len(strconv.Itoa(concurrent)),
585 }
586}
587
588// update writes out the progress of the replicated job.
589func (u *replicatedJobProgressUpdater) update(_ swarm.Service, tasks []swarm.Task, _ map[string]struct{}, _ bool) (bool, error) {

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…