MCPcopy
hub / github.com/SurgeDM/Surge / SetChunkProgress

Method SetChunkProgress

internal/engine/types/progress.go:371–382  ·  view source on GitHub ↗

SetChunkProgress updates chunk progress array from external sources (e.g. remote events).

(progress []int64)

Source from the content-addressed store, hash-verified

369
370// SetChunkProgress updates chunk progress array from external sources (e.g. remote events).
371func (ps *ProgressState) SetChunkProgress(progress []int64) {
372 ps.mu.Lock()
373 defer ps.mu.Unlock()
374
375 if len(progress) == 0 {
376 return
377 }
378 if len(ps.ChunkProgress) != len(progress) {
379 ps.ChunkProgress = make([]int64, len(progress))
380 }
381 copy(ps.ChunkProgress, progress)
382}
383
384// SetChunkState sets the 2-bit state for a specific chunk index (thread-safe)
385func (ps *ProgressState) SetChunkState(index int, status ChunkStatus) {

Callers 1

processProgressMsgMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected