func (r *Manager) Start(interval time.Duration) {
	if !r.IsInitialized() {
		return
	}
	logger.Log().Infof("starting reflection schedule (every %v minutes)", interval.Minutes())
	ticker := time.NewTicker(interval)

	go func() {
		for {
			select {
			case <-r.stopChan:
				logger.Log().Info("stopping reflection...")
				ticker.Stop()
				logger.Log().Info("stopped")
				return
			case <-ticker.C:
				stats, err := r.ReflectAll()
				if err != nil {
					logger.Log().Errorf("failed to reflect blobs: %v", err)
				} else {
					logger.Log().Infof(
						"total blob: %v, reflected/removed: %v, errors encountered: %v",
						stats.TotalBlobs, stats.ReflectedBlobs, len(stats.Errors),
					)
					for _, e := range stats.Errors {
						logger.Log().Errorf("blob %v: %v", e.FilePath, e.Error)
					}
				}
			}
		}
	}()
}
// Start launches blob upload procedure at specified intervals.
// If upload duration at the end exceeds specified interval, it will just start the upload again after it's done.
Start launches blob upload procedure at specified intervals.
If upload duration at the end exceeds specified interval, it will just start the upload again after it's done.
// Start launches blob upload procedure at specified intervals . // If upload duration at the end exceeds specified interval it will just start the upload again after it ' s done .
func (r *Manager) Start(interval time.Duration) {
	if !r.IsInitialized() {
		return
	}
	logger.Log().Infof("starting reflection schedule (every %v minutes)", interval.Minutes())
	ticker := time.NewTicker(interval)
	go func() {
		for {
			select {
			case <-r.stopChan:
				logger.Log().Info("stopping reflection...")
				ticker.Stop()
				logger.Log().Info("stopped")
				return
			case <-ticker.C:
				stats, err := r.ReflectAll()
				if err != nil {
					logger.Log().Errorf("failed to reflect blobs: %v", err)
				} else {
					logger.Log().Infof(
						"total blob: %v, reflected/removed: %v, errors encountered: %v",
						stats.TotalBlobs, stats.ReflectedBlobs, len(stats.Errors),
					)
					for _, e := range stats.Errors {
						logger.Log().Errorf("blob %v: %v", e.FilePath, e.Error)
					}
				}
			}
		}
	}()
}
func ( r * Manager ) Start ( interval time . Duration ) { if ! r . IsInitialized ( ) { return } logger . Log ( ) . Infof ( " " , interval . Minutes ( ) ) ticker := time . NewTicker ( interval ) go func ( ) { for { select { case <- r . stopChan : logger . Log ( ) . Info ( " " ) ticker . Stop ( ) logger . Log ( ) . Info ( " " ) return case <- ticker . C : stats , err := r . ReflectAll ( ) if err != nil { logger . Log ( ) . Errorf ( " " , err ) } else { logger . Log ( ) . Infof ( " " , stats . TotalBlobs , stats . ReflectedBlobs , len ( stats . Errors ) , ) for _ , e := range stats . Errors { logger . Log ( ) . Errorf ( " " , e . FilePath , e . Error ) } } } } } ( ) }
Start launches blob upload procedure at specified intervals.
Start launches blob upload procedure at specified intervals .