velodrome/transform/fetcher.go
func (f *Fetcher) fetchRecentIssues(db *gorm.DB) error {
	glog.Infof("Fetching issues updated after %s", f.lastIssue)

	var issues []sql.Issue
	query := db.
		Where("issue_updated_at >= ?", f.lastIssue).
		Where("repository = ?", f.repository).
		Order("issue_updated_at").
		Preload("Labels").
		Find(&issues)
	if query.Error != nil {
		return query.Error
	}

	count := len(issues)
	for _, issue := range issues {
		f.IssuesChannel <- issue
		f.lastIssue = issue.IssueUpdatedAt
	}
	glog.Infof("Found and pushed %d updated/new issues", count)

	return nil
}
func (f *Fetcher) fetchRecentIssues(db *gorm.DB) error {
	glog.Infof("Fetching issues updated after %s", f.lastIssue)

	var issues []sql.Issue
	query := db.
		Where("issue_updated_at >= ?", f.lastIssue).
		Where("repository = ?", f.repository).
		Order("issue_updated_at").
		Preload("Labels").
		Find(&issues)
	if query.Error != nil {
		return query.Error
	}

	count := len(issues)
	for _, issue := range issues {
		f.IssuesChannel <- issue
		f.lastIssue = issue.IssueUpdatedAt
	}
	glog.Infof("Found and pushed %d updated/new issues", count)

	return nil
}
func ( f * Fetcher ) fetchRecentIssues ( db * gorm . DB ) error { glog . Infof ( " " , f . lastIssue ) var issues [ ] sql . Issue query := db . Where ( " " , f . lastIssue ) . Where ( " " , f . repository ) . Order ( " " ) . Preload ( " " ) . Find ( & issues ) if query . Error != nil { return query . Error } count := len ( issues ) for _ , issue := range issues { f . IssuesChannel <- issue f . lastIssue = issue . IssueUpdatedAt } glog . Infof ( " " , count ) return nil }
// fetchRecentIssues retrieves issues from DB, but only fetches issues modified since last call
fetchRecentIssues retrieves issues from DB but only fetches issues modified since last call