fix: simplify deleting

This commit is contained in:
Jason Song
2023-01-05 15:40:19 +08:00
parent c3d7f15513
commit eee662442a
3 changed files with 22 additions and 49 deletions

View File

@@ -20,7 +20,6 @@ import (
"code.gitea.io/gitea/modules/notification"
repo_module "code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/setting"
actions_service "code.gitea.io/gitea/services/actions"
pull_service "code.gitea.io/gitea/services/pull"
)
@@ -52,11 +51,6 @@ func DeleteRepository(ctx context.Context, doer *user_model.User, repo *repo_mod
return err
}
// deletes actions resource after the repo has been deleted, to avoid new tasks
if err := actions_service.DeleteResourceOfRepository(ctx, repo); err != nil {
return fmt.Errorf("delete actions resources failed: %w", err)
}
return packages_model.UnlinkRepositoryFromAllPackages(ctx, repo.ID)
}