MCPcopy
hub / github.com/git-lfs/git-lfs / ensureAdapterBegun

Method ensureAdapterBegun

tq/transfer_queue.go:924–955  ·  view source on GitHub ↗
(e lfshttp.Endpoint)

Source from the content-addressed store, hash-verified

922}
923
924func (q *TransferQueue) ensureAdapterBegun(e lfshttp.Endpoint) error {
925 q.Upgrade()
926
927 q.adapterInitMutex.Lock()
928 defer q.adapterInitMutex.Unlock()
929
930 if q.adapterInProgress {
931 return nil
932 }
933
934 // Progress callback - receives byte updates
935 cb := func(name string, total, read int64, current int) error {
936 q.meter.TransferBytes(q.direction.String(), name, read, total, current)
937 if q.cb != nil {
938 // NOTE: this is the mechanism by which the logpath
939 // specified by GIT_LFS_PROGRESS is written to.
940 //
941 // See: lfs.downloadFile() for more.
942 q.cb(total, read, current)
943 }
944 return nil
945 }
946
947 tracerx.Printf("tq: starting transfer adapter %q", q.adapter.Name())
948 err := q.adapter.Begin(q.toAdapterCfg(e), cb)
949 if err != nil {
950 return err
951 }
952 q.adapterInProgress = true
953
954 return nil
955}
956
957func (q *TransferQueue) toAdapterCfg(e lfshttp.Endpoint) AdapterConfig {
958 apiClient := q.manifest.APIClient()

Callers 1

addToAdapterMethod · 0.95

Calls 8

UpgradeMethod · 0.95
toAdapterCfgMethod · 0.95
TransferBytesMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65
StringMethod · 0.65
NameMethod · 0.65
BeginMethod · 0.65

Tested by

no test coverage detected