MCPcopy Create free account
hub / github.com/gogs/gogs / getCommentsByRepoIDSince

Function getCommentsByRepoIDSince

internal/database/comment.go:447–457  ·  view source on GitHub ↗
(e Engine, repoID, since int64)

Source from the content-addressed store, hash-verified

445}
446
447func getCommentsByRepoIDSince(e Engine, repoID, since int64) ([]*Comment, error) {
448 comments := make([]*Comment, 0, 10)
449 sess := e.Where("issue.repo_id = ?", repoID).Join("INNER", "issue", "issue.id = comment.issue_id").Asc("comment.created_unix")
450 if since > 0 {
451 sess.And("comment.updated_unix >= ?", since)
452 }
453 if err := sess.Find(&comments); err != nil {
454 return nil, err
455 }
456 return comments, loadCommentsAttributes(e, comments)
457}
458
459func getCommentsByIssueID(e Engine, issueID int64) ([]*Comment, error) {
460 return getCommentsByIssueIDSince(e, issueID, -1)

Callers 1

GetCommentsByRepoIDSinceFunction · 0.85

Calls 3

loadCommentsAttributesFunction · 0.85
WhereMethod · 0.80
FindMethod · 0.65

Tested by

no test coverage detected