prow/gerrit/adapter/adapter.go
func (c *Controller) Sync() error {
	syncTime := c.lastUpdate

	for instance, changes := range c.gc.QueryChanges(c.lastUpdate, c.config().Gerrit.RateLimit) {
		for _, change := range changes {
			if err := c.ProcessChange(instance, change); err != nil {
				logrus.WithError(err).Errorf("Failed process change %v", change.CurrentRevision)
			}
			if syncTime.Before(change.Updated.Time) {
				syncTime = change.Updated.Time
			}
		}

		logrus.Infof("Processed %d changes for instance %s", len(changes), instance)
	}

	c.lastUpdate = syncTime
	if err := c.SaveLastSync(syncTime); err != nil {
		logrus.WithError(err).Errorf("last sync %v, cannot save to path %v", syncTime, c.lastSyncFallback)
	}

	return nil
}
func (c *Controller) Sync() error {
	syncTime := c.lastUpdate

	for instance, changes := range c.gc.QueryChanges(c.lastUpdate, c.config().Gerrit.RateLimit) {
		for _, change := range changes {
			if err := c.ProcessChange(instance, change); err != nil {
				logrus.WithError(err).Errorf("Failed process change %v", change.CurrentRevision)
			}
			if syncTime.Before(change.Updated.Time) {
				syncTime = change.Updated.Time
			}
		}

		logrus.Infof("Processed %d changes for instance %s", len(changes), instance)
	}

	c.lastUpdate = syncTime
	if err := c.SaveLastSync(syncTime); err != nil {
		logrus.WithError(err).Errorf("last sync %v, cannot save to path %v", syncTime, c.lastSyncFallback)
	}

	return nil
}
func ( c * Controller ) Sync ( ) error { syncTime := c . lastUpdate for instance , changes := range c . gc . QueryChanges ( c . lastUpdate , c . config ( ) . Gerrit . RateLimit ) { for _ , change := range changes { if err := c . ProcessChange ( instance , change ) ; err != nil { logrus . WithError ( err ) . Errorf ( " " , change . CurrentRevision ) } if syncTime . Before ( change . Updated . Time ) { syncTime = change . Updated . Time } } logrus . Infof ( " " , len ( changes ) , instance ) } c . lastUpdate = syncTime if err := c . SaveLastSync ( syncTime ) ; err != nil { logrus . WithError ( err ) . Errorf ( " " , syncTime , c . lastSyncFallback ) } return nil }
// Sync looks for newly made gerrit changes
// and creates prowjobs according to specs
Sync looks for newly made gerrit changes and creates prowjobs according to specs