@@ -3400,7 +3400,7 @@ func (j *DSGitHub) FetchItemsPullRequest(ctx *shared.Ctx) (err error) {
3400
3400
count += len (pulls .Issues )
3401
3401
totalFetched += len (pulls .Issues )
3402
3402
pullrequests = append (pullrequests , pulls .Issues ... )
3403
- if len (pullrequests ) == 1000 || response .NextPage == 0 {
3403
+ if len (pullrequests ) == ctx . PackSize || response .NextPage == 0 {
3404
3404
for _ , pull := range pullrequests {
3405
3405
pr := map [string ]interface {}{}
3406
3406
jm , _ := jsoniter .Marshal (pull )
@@ -3432,19 +3432,23 @@ func (j *DSGitHub) FetchItemsPullRequest(ctx *shared.Ctx) (err error) {
3432
3432
j .log .WithFields (logrus.Fields {"operation" : "FetchItemsPullRequest" }).Debugf ("%d remaining pulls to send to queue" , nPulls )
3433
3433
}
3434
3434
3435
- if count == 1000 {
3436
- j .log .WithFields (logrus.Fields {"operation" : "FetchItemsActions " }).Infof ("fetched %d pulls" , totalFetched )
3435
+ if count == ctx . PackSize {
3436
+ j .log .WithFields (logrus.Fields {"operation" : "FetchItemsPullRequest " }).Infof ("fetched %d pulls" , totalFetched )
3437
3437
dateFrom = updateAt
3438
3438
opt .Page = 1
3439
3439
count = 0
3440
3440
continue
3441
3441
}
3442
3442
if response .NextPage == 0 {
3443
+ err = j .GitHubEnrichItems (ctx , allPulls , & allDocs , true )
3444
+ if err != nil {
3445
+ j .log .WithFields (logrus.Fields {"operation" : "FetchItemsPullRequest" }).Errorf ("%s/%s: error %v sending %d pulls to queue" , j .URL , j .CurrentCategory , err , len (allPulls ))
3446
+ }
3443
3447
break
3444
3448
}
3445
3449
opt .Page = response .NextPage
3446
3450
}
3447
- j .log .WithFields (logrus.Fields {"operation" : "FetchItemsActions " }).Infof ("total count of fetched pulls: %d, fetched till: %v" , totalFetched , latestUpdateAt )
3451
+ j .log .WithFields (logrus.Fields {"operation" : "FetchItemsPullRequest " }).Infof ("total count of fetched pulls: %d, fetched till: %v" , totalFetched , latestUpdateAt )
3448
3452
3449
3453
return
3450
3454
}
@@ -6098,6 +6102,9 @@ func (j *DSGitHub) Sync(ctx *shared.Ctx, category string) (err error) {
6098
6102
}
6099
6103
// NOTE: Non-generic ends here
6100
6104
err = j .setLastSync ()
6105
+ if err != nil {
6106
+ return
6107
+ }
6101
6108
j .log .WithFields (logrus.Fields {"operation" : "SetLastSync" }).Info ("Sync: last sync date has been updated successfully" )
6102
6109
6103
6110
return
0 commit comments