MCPcopy
hub / github.com/syncthing/syncthing / pullDone

Method pullDone

lib/model/sharedpullerstate.go:305–314  ·  view source on GitHub ↗
(block protocol.BlockInfo)

Source from the content-addressed store, hash-verified

303}
304
305func (s *sharedPullerState) pullDone(block protocol.BlockInfo) {
306 s.mut.Lock()
307 s.pullNeeded--
308 s.updated = time.Now()
309 s.available = append(s.available, int(block.Offset/int64(s.file.BlockSize())))
310 s.availableUpdated = time.Now()
311 l.Debugln("sharedPullerState", s.folder, s.file.Name, "pullNeeded done ->", s.pullNeeded)
312 s.mut.Unlock()
313 metricFolderProcessedBytesTotal.WithLabelValues(s.folder, metricSourceNetwork).Add(float64(block.Size))
314}
315
316// finalClose atomically closes and returns closed status of a file. A true
317// first return value means the file was closed and should be finished, with

Callers 3

TestProgressEmitterFunction · 0.95
pullerRoutineMethod · 0.80
pullBlockMethod · 0.80

Calls 5

DebuglnMethod · 0.80
UnlockMethod · 0.80
NowMethod · 0.65
BlockSizeMethod · 0.45
AddMethod · 0.45

Tested by 1

TestProgressEmitterFunction · 0.76