MCPcopy
hub / github.com/perkeep/perkeep / newSyncHandler

Function newSyncHandler

pkg/server/sync.go:236–253  ·  view source on GitHub ↗
(fromName, toName string,
	from blobserver.Storage, to blobReceiverEnumerator,
	queue sorted.KeyValue)

Source from the content-addressed store, hash-verified

234}
235
236func newSyncHandler(fromName, toName string,
237 from blobserver.Storage, to blobReceiverEnumerator,
238 queue sorted.KeyValue) *SyncHandler {
239 return &SyncHandler{
240 copierPoolSize: 5,
241 from: from,
242 to: to,
243 fromName: fromName,
244 toName: toName,
245 queue: queue,
246 wakec: make(chan bool),
247 status: "not started",
248 needCopy: make(map[blob.Ref]uint32),
249 lastFail: make(map[blob.Ref]failDetail),
250 copying: make(map[blob.Ref]*copyStatus),
251 alarmIdlec: make(chan struct{}),
252 }
253}
254
255// NewSyncHandler returns a handler that will asynchronously and continuously
256// copy blobs from src to dest, if missing on dest.

Callers 2

newSyncFromConfigFunction · 0.85
NewSyncHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected