MCPcopy Create free account
hub / github.com/FlashpointProject/FlashpointUltimateUpdater / Stop

Method Stop

downloader.go:503–526  ·  view source on GitHub ↗
(skipCancelContext bool)

Source from the content-addressed store, hash-verified

501}
502
503func (d *Downloader) Stop(skipCancelContext bool) {
504 if !d.running {
505 return
506 }
507
508 // Stop new and current requests
509 if !skipCancelContext {
510 d.cancel()
511 }
512 d.newRequestWg.Wait()
513 close(d.reqch)
514
515 // Let workers try to trigger exit first
516 d.workerWg.Wait()
517 close(d.respch)
518
519 // Wait for all responses to finish processing
520 d.responderWg.Wait()
521 close(d.updatech)
522 d.updaterWg.Wait()
523
524 d.running = false
525 _ = d.state.runningLabel.Set("Stopped")
526}
527
528func (d *Downloader) NewRequest(f *IndexedFile) (*grab.Request, error) {
529 // Set up request

Callers 3

ResumeMethod · 0.95
setupLayoutFunction · 0.80
mainLayoutFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected