Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
totegamma committed Oct 12, 2024
1 parent 8ca8e0c commit 416caae
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions x/store/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,16 @@ func (r *repository) SyncCommitFile(ctx context.Context, owner string) error {
for {
fmt.Printf("dump lastSignedAt: %v\n", lastSignedAt)
var commits []core.CommitLog
err := r.db.
WithContext(ctx).

query := r.db.WithContext(ctx).
Where("? = ANY(owners)", owner).
Where("is_ephemeral = ?", false).
Where("signed_at > ?", lastSignedAt).
Order("signed_at ASC").
Find(&commits).
Limit(pageSize).
Error
Where("is_ephemeral = ?", false)

if lastSignedAt.IsZero() {
query = query.Order("signed_at ASC")
}

err = query.Find(&commits).Limit(pageSize).Error

if err != nil {
span.RecordError(err)
Expand Down

0 comments on commit 416caae

Please sign in to comment.