diff options
Diffstat (limited to 'services/repository/check.go')
-rw-r--r-- | services/repository/check.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/services/repository/check.go b/services/repository/check.go index 6adb8479c4..6962090f84 100644 --- a/services/repository/check.go +++ b/services/repository/check.go @@ -27,7 +27,7 @@ func GitFsck(ctx context.Context, timeout time.Duration, args []string) error { log.Trace("Doing: GitFsck") if err := db.Iterate( - db.DefaultContext, + ctx, new(repo_model.Repository), builder.Expr("id>0 AND is_fsck_enabled=?", true), func(idx int, bean interface{}) error { @@ -62,7 +62,7 @@ func GitGcRepos(ctx context.Context, timeout time.Duration, args ...string) erro args = append([]string{"gc"}, args...) if err := db.Iterate( - db.DefaultContext, + ctx, new(repo_model.Repository), builder.Gt{"id": 0}, func(idx int, bean interface{}) error { @@ -97,7 +97,7 @@ func GitGcRepos(ctx context.Context, timeout time.Duration, args ...string) erro } // Now update the size of the repository - if err := models.UpdateRepoSize(db.DefaultContext, repo); err != nil { + if err := models.UpdateRepoSize(ctx, repo); err != nil { log.Error("Updating size as part of garbage collection failed for %v. Stdout: %s\nError: %v", repo, stdout, err) desc := fmt.Sprintf("Updating size as part of garbage collection failed for %s. Stdout: %s\nError: %v", repo.RepoPath(), stdout, err) if err = admin_model.CreateRepositoryNotice(desc); err != nil { @@ -119,7 +119,7 @@ func GitGcRepos(ctx context.Context, timeout time.Duration, args ...string) erro func gatherMissingRepoRecords(ctx context.Context) ([]*repo_model.Repository, error) { repos := make([]*repo_model.Repository, 0, 10) if err := db.Iterate( - db.DefaultContext, + ctx, new(repo_model.Repository), builder.Gt{"id": 0}, func(idx int, bean interface{}) error { |