MCPcopy
hub / github.com/wal-g/wal-g / StartQueue

Method StartQueue

internal/tar_ball_queue.go:36–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36func (tarQueue *TarBallQueue) StartQueue() error {
37 if tarQueue.started.Load() {
38 panic("Trying to start already started Queue")
39 }
40 var err error
41 tarQueue.parallelTarballs, err = conf.GetMaxUploadDiskConcurrency()
42 if err != nil {
43 return err
44 }
45 tarQueue.maxUploadQueue, err = conf.GetMaxUploadQueue()
46 if err != nil {
47 return err
48 }
49
50 tarQueue.tarsToFillQueue = make(chan TarBall, tarQueue.parallelTarballs)
51 tarQueue.uploadQueue = make(chan TarBall, tarQueue.parallelTarballs+tarQueue.maxUploadQueue)
52 for i := 0; i < tarQueue.parallelTarballs; i++ {
53 tarQueue.NewTarBall(true)
54 tarQueue.tarsToFillQueue <- tarQueue.LastCreatedTarball
55 }
56
57 tarQueue.started.Store(true)
58 return nil
59}
60
61// DequeCtx returns a TarBall from the queue. If the context finishes before it
62// can do so, it returns the result of ctx.Err().

Callers 2

TestS3TarBallFunction · 0.95
TestS3DependentFunctionsFunction · 0.95

Calls 3

NewTarBallMethod · 0.95
LoadMethod · 0.45
StoreMethod · 0.45

Tested by 2

TestS3TarBallFunction · 0.76
TestS3DependentFunctionsFunction · 0.76