aboutsummaryrefslogtreecommitdiffstats
path: root/services/cron/tasks_basic.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/cron/tasks_basic.go')
-rw-r--r--services/cron/tasks_basic.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/services/cron/tasks_basic.go b/services/cron/tasks_basic.go
index 4832ca98a7..814f6eae4e 100644
--- a/services/cron/tasks_basic.go
+++ b/services/cron/tasks_basic.go
@@ -9,6 +9,7 @@ import (
"time"
"code.gitea.io/gitea/models"
+ user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/models/webhook"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/services/auth"
@@ -33,7 +34,7 @@ func registerUpdateMirrorTask() {
},
PullLimit: 50,
PushLimit: 50,
- }, func(ctx context.Context, _ *models.User, cfg Config) error {
+ }, func(ctx context.Context, _ *user_model.User, cfg Config) error {
umtc := cfg.(*UpdateMirrorTaskConfig)
return mirror_service.Update(ctx, umtc.PullLimit, umtc.PushLimit)
})
@@ -53,7 +54,7 @@ func registerRepoHealthCheck() {
},
Timeout: 60 * time.Second,
Args: []string{},
- }, func(ctx context.Context, _ *models.User, config Config) error {
+ }, func(ctx context.Context, _ *user_model.User, config Config) error {
rhcConfig := config.(*RepoHealthCheckConfig)
return repository_service.GitFsck(ctx, rhcConfig.Timeout, rhcConfig.Args)
})
@@ -64,7 +65,7 @@ func registerCheckRepoStats() {
Enabled: true,
RunAtStart: true,
Schedule: "@midnight",
- }, func(ctx context.Context, _ *models.User, _ Config) error {
+ }, func(ctx context.Context, _ *user_model.User, _ Config) error {
return models.CheckRepoStats(ctx)
})
}
@@ -77,7 +78,7 @@ func registerArchiveCleanup() {
Schedule: "@midnight",
},
OlderThan: 24 * time.Hour,
- }, func(ctx context.Context, _ *models.User, config Config) error {
+ }, func(ctx context.Context, _ *user_model.User, config Config) error {
acConfig := config.(*OlderThanConfig)
return models.DeleteOldRepositoryArchives(ctx, acConfig.OlderThan)
})
@@ -91,7 +92,7 @@ func registerSyncExternalUsers() {
Schedule: "@midnight",
},
UpdateExisting: true,
- }, func(ctx context.Context, _ *models.User, config Config) error {
+ }, func(ctx context.Context, _ *user_model.User, config Config) error {
realConfig := config.(*UpdateExistingConfig)
return auth.SyncExternalUsers(ctx, realConfig.UpdateExisting)
})
@@ -105,7 +106,7 @@ func registerDeletedBranchesCleanup() {
Schedule: "@midnight",
},
OlderThan: 24 * time.Hour,
- }, func(ctx context.Context, _ *models.User, config Config) error {
+ }, func(ctx context.Context, _ *user_model.User, config Config) error {
realConfig := config.(*OlderThanConfig)
models.RemoveOldDeletedBranches(ctx, realConfig.OlderThan)
return nil
@@ -117,7 +118,7 @@ func registerUpdateMigrationPosterID() {
Enabled: true,
RunAtStart: true,
Schedule: "@midnight",
- }, func(ctx context.Context, _ *models.User, _ Config) error {
+ }, func(ctx context.Context, _ *user_model.User, _ Config) error {
return migrations.UpdateMigrationPosterID(ctx)
})
}
@@ -132,7 +133,7 @@ func registerCleanupHookTaskTable() {
CleanupType: "OlderThan",
OlderThan: 168 * time.Hour,
NumberToKeep: 10,
- }, func(ctx context.Context, _ *models.User, config Config) error {
+ }, func(ctx context.Context, _ *user_model.User, config Config) error {
realConfig := config.(*CleanupHookTaskConfig)
return webhook.CleanupHookTaskTable(ctx, webhook.ToHookTaskCleanupType(realConfig.CleanupType), realConfig.OlderThan, realConfig.NumberToKeep)
})