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

Commit 3808f9e

Browse files
Remove content field value from cache (#99)
* remove content field value from cache Signed-off-by: Ayman <[email protected]> * clean up Signed-off-by: Ayman <[email protected]> --------- Signed-off-by: Ayman <[email protected]> Co-authored-by: Ayman <[email protected]>
1 parent cc2630d commit 3808f9e

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

cmd/git/git.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,14 +1831,18 @@ func (j *DSGit) GitEnrichItems(ctx *shared.Ctx, thrN int, items []interface{}, d
18311831
if !hashExist && !isCreated {
18321832
formattedData = append(formattedData, d)
18331833
tStamp := d.Payload.SyncTimestamp.Unix()
1834-
commits = append(commits, CommitCache{
1834+
comm := CommitCache{
18351835
Timestamp: fmt.Sprintf("%v", tStamp),
18361836
EntityID: d.Payload.ID,
18371837
SourceEntityID: d.Payload.SHA,
18381838
Content: commitStr,
18391839
Hash: contentHash,
18401840
CommitDate: d.Payload.CommittedTimestamp,
1841-
})
1841+
}
1842+
if IsHotRep {
1843+
comm.Content = ""
1844+
}
1845+
commits = append(commits, comm)
18421846
createdCommits[d.Payload.ID] = true
18431847
}
18441848
if isCreated && !hashExist {
@@ -1852,14 +1856,18 @@ func (j *DSGit) GitEnrichItems(ctx *shared.Ctx, thrN int, items []interface{}, d
18521856
}
18531857
updatedData = append(updatedData, updatedEvent)
18541858
tStamp := d.Payload.SyncTimestamp.Unix()
1855-
updateCommits = append(updateCommits, CommitCache{
1859+
comm := CommitCache{
18561860
Timestamp: fmt.Sprintf("%v", tStamp),
18571861
EntityID: d.Payload.ID,
18581862
SourceEntityID: d.Payload.SHA,
18591863
Content: commitStr,
18601864
Hash: contentHash,
18611865
CommitDate: d.Payload.CommittedTimestamp,
1862-
})
1866+
}
1867+
if IsHotRep {
1868+
comm.Content = ""
1869+
}
1870+
updateCommits = append(updateCommits, comm)
18631871
}
18641872

18651873
}

0 commit comments

Comments
 (0)