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

Method flushWithTime

internal/engine/single/downloader.go:279–296  ·  view source on GitHub ↗
(now time.Time)

Source from the content-addressed store, hash-verified

277}
278
279func (w *progressReader) flushWithTime(now time.Time) {
280 if w.state == nil {
281 w.pending = 0
282 w.lastFlush = now
283 w.readChecks = 0
284 return
285 }
286
287 if w.pending == 0 && w.written == 0 {
288 return
289 }
290
291 w.state.Downloaded.Store(w.written)
292 w.state.VerifiedProgress.Store(w.written)
293 w.pending = 0
294 w.lastFlush = now
295 w.readChecks = 0
296}

Callers 2

ReadMethod · 0.95
FlushMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected