aboutsummaryrefslogtreecommitdiffstats
path: root/services/wiki
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-01-13 05:50:38 +0800
committerGitHub <noreply@github.com>2024-01-12 21:50:38 +0000
commit97292da96048b036cbe36b3ea66503ac568a73e7 (patch)
tree3104c11d619e6b11a82d6a898354dc4cf64ed0be /services/wiki
parent6c6823935c4810a071a3919a88819b0ed156bf43 (diff)
downloadgitea-97292da96048b036cbe36b3ea66503ac568a73e7.tar.gz
gitea-97292da96048b036cbe36b3ea66503ac568a73e7.zip
Fix schedule tasks bugs (#28691)
Fix #28157 This PR fix the possible bugs about actions schedule. ## The Changes - Move `UpdateRepositoryUnit` and `SetRepoDefaultBranch` from models to service layer - Remove schedules plan from database and cancel waiting & running schedules tasks in this repository when actions unit has been disabled or global disabled. - Remove schedules plan from database and cancel waiting & running schedules tasks in this repository when default branch changed.
Diffstat (limited to 'services/wiki')
-rw-r--r--services/wiki/wiki.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/wiki/wiki.go b/services/wiki/wiki.go
index f98854c8dd..ce54a00da7 100644
--- a/services/wiki/wiki.go
+++ b/services/wiki/wiki.go
@@ -19,6 +19,7 @@ import (
repo_module "code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/sync"
asymkey_service "code.gitea.io/gitea/services/asymkey"
+ repo_service "code.gitea.io/gitea/services/repository"
)
// TODO: use clustered lock (unique queue? or *abuse* cache)
@@ -350,7 +351,7 @@ func DeleteWikiPage(ctx context.Context, doer *user_model.User, repo *repo_model
// DeleteWiki removes the actual and local copy of repository wiki.
func DeleteWiki(ctx context.Context, repo *repo_model.Repository) error {
- if err := repo_model.UpdateRepositoryUnits(ctx, repo, nil, []unit.Type{unit.TypeWiki}); err != nil {
+ if err := repo_service.UpdateRepositoryUnits(ctx, repo, nil, []unit.Type{unit.TypeWiki}); err != nil {
return err
}