Skip to content

Commit

Permalink
Add aditional logs to fetch job
Browse files Browse the repository at this point in the history
  • Loading branch information
Flexicon committed Dec 11, 2022
1 parent a9b11a4 commit 26cfd90
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fetch_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ func runFetchJob(db *gorm.DB, api *GitHubAPI) error {
if len(commits) != 0 {
return saveCommitLog(db, commits)
}

log.Println("No commits to save")
return nil
}

Expand All @@ -53,7 +55,8 @@ func searchSketchyCommits(api *GitHubAPI) ([]SearchResultItem, error) {
results = append(results, r...)

if i < len(QueryKeywords)-1 {
// Wait a bit in between queries - GitHub secondary rate limiting is strict.
// GitHub secondary rate limiting is strict
log.Println("Waiting a bit in between keyword queries (10s)")
time.Sleep(10 * time.Second)
}
}
Expand Down Expand Up @@ -151,6 +154,7 @@ func containsDaysInThePast(items []SearchResultItem) bool {
commitDate, err := item.ParseCommitDate()

if err == nil && isDateInThePast(commitDate) {
debugLog(fmt.Sprintf("Day in past found: %v for commit %s", commitDate, item.SHA))
return true
}
}
Expand Down

0 comments on commit 26cfd90

Please sign in to comment.