MCPcopy
hub / github.com/rclone/rclone / startReadWorkers

Method startReadWorkers

backend/cache/handle.go:100–119  ·  view source on GitHub ↗

startReadWorkers will start the worker pool

()

Source from the content-addressed store, hash-verified

98
99// startReadWorkers will start the worker pool
100func (r *Handle) startReadWorkers() {
101 if r.workers > 0 {
102 return
103 }
104 totalWorkers := r.cacheFs().opt.TotalWorkers
105
106 if r.cacheFs().plexConnector.isConfigured() {
107 if !r.cacheFs().plexConnector.isConnected() {
108 err := r.cacheFs().plexConnector.authenticate()
109 if err != nil {
110 fs.Errorf(r, "failed to authenticate to Plex: %v", err)
111 }
112 }
113 if r.cacheFs().plexConnector.isConnected() {
114 totalWorkers = 1
115 }
116 }
117
118 r.scaleWorkers(totalWorkers)
119}
120
121// scaleWorkers will increase the worker pool count by the provided amount
122func (r *Handle) scaleWorkers(desired int) {

Callers 1

NewObjectHandleFunction · 0.95

Calls 6

cacheFsMethod · 0.95
scaleWorkersMethod · 0.95
ErrorfFunction · 0.92
isConfiguredMethod · 0.80
isConnectedMethod · 0.80
authenticateMethod · 0.45

Tested by

no test coverage detected