Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
code clean up (#76)
Browse files Browse the repository at this point in the history
Signed-off-by: Ayman <[email protected]>
Co-authored-by: Ayman <[email protected]>
  • Loading branch information
khalifapro and enkhalifapro authored Feb 28, 2023
1 parent e5879fd commit 704b426
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions cmd/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -3422,12 +3422,7 @@ func (j *DSGitHub) FetchItemsPullRequest(ctx *shared.Ctx) (err error) {
if ctx.Debug > 0 {
j.log.WithFields(logrus.Fields{"operation": "FetchItemsPullRequest"}).Debugf("%d remaining pulls to send to queue", nPulls)
}
err = j.GitHubEnrichItems(ctx, allPulls, &allDocs, true)
//err = SendToQueue(ctx, j, true, UUID, allPulls)
if err != nil {
j.log.WithFields(logrus.Fields{"operation": "FetchItemsPullRequest"}).Errorf("%s/%s: error %v sending %d pulls to queue", j.URL, j.CurrentCategory, err, len(allPulls))
}
allPulls = make([]interface{}, 0)

if count == 1000 {
j.log.WithFields(logrus.Fields{"operation": "FetchItemsActions"}).Infof("fetched %d pulls", totalFetched)
dateFrom = updateAt
Expand Down Expand Up @@ -8843,14 +8838,15 @@ func (j *DSGitHub) AddCacheProvider() {
func (j *DSGitHub) cacheCreatedPullrequest(v []interface{}, path string) error {
for _, val := range v {
pr := val.(igh.PullRequestCreatedEvent).Payload
syncTimestamp := fmt.Sprintf("%v", pr.SyncTimestamp.Unix())
pr.SyncTimestamp = time.Time{}
b, err := json.Marshal(pr)
if err != nil {
return err
}
contentHash := fmt.Sprintf("%x", sha256.Sum256(b))
cachedPulls[contentHash] = ItemCache{
Timestamp: fmt.Sprintf("%v", pr.SyncTimestamp.Unix()),
Timestamp: syncTimestamp,
EntityID: pr.ID,
SourceEntityID: pr.ChangeRequestID,
FileLocation: path,
Expand Down

0 comments on commit 704b426

Please sign in to comment.