code: func (sync *NodeSync) Loop(done chan struct{}) {
  	klog.V(2).Infof("Starting sync loop for node %q", sync.nodeName)
  
  	defer func() {
  		if done != nil {
  			close(done)
  		}
  	}()
  
  	timeout := sync.c.ResyncTimeout()
  	delayTimer := time.NewTimer(timeout)
  	klog.V(4).Infof("Resync node %q in %v", sync.nodeName, timeout)
  
  	for {
  		select {
  		case op, more := <-sync.opChan:
  			if !more {
  				klog.V(2).Infof("Stopping sync loop")
  				return
  			}
  			sync.c.ReportResult(op.run(sync))
  			if !delayTimer.Stop() {
  				<-delayTimer.C
  			}
  		case <-delayTimer.C:
  			klog.V(4).Infof("Running resync for node %q", sync.nodeName)
  			sync.c.ReportResult((&updateOp{}).run(sync))
  		}
  
  		timeout := sync.c.ResyncTimeout()
  		delayTimer.Reset(timeout)
  		klog.V(4).Infof("Resync node %q in %v", sync.nodeName, timeout)
  	}
  }
docs: // Loop runs the sync loop for a given node. done is an optional channel that
  // is closed when the Loop() returns.