...

Source file src/code.rocketnine.space/tslocum/gophast/pkg/manager/manager.go

Documentation: code.rocketnine.space/tslocum/gophast/pkg/manager

     1  package manager
     2  
     3  import (
     4  	"gitlab.com/tslocum/gophast/pkg/config"
     5  )
     6  
     7  var (
     8  	Version string
     9  )
    10  
    11  func Initialize(logLevel int) error {
    12  	config.C.MaxLogLevel = config.LogLevel(logLevel)
    13  	return nil
    14  }
    15  
    16  func WaitAll() {
    17  	config.WG.Wait()
    18  }
    19  
    20  func Shutdown() error {
    21  	managerLock.Lock()
    22  	defer managerLock.Unlock()
    23  
    24  	for _, md := range downloads {
    25  		md.d.Cancel()
    26  	}
    27  
    28  	for _, md := range downloads {
    29  		md.d.Wait()
    30  	}
    31  
    32  	return nil
    33  }
    34  

View as plain text