aboutsummaryrefslogtreecommitdiffstats
path: root/models/migrations/v1_22/v296.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2025-04-07 22:12:54 -0700
committerGitHub <noreply@github.com>2025-04-07 22:12:54 -0700
commita100ac3306000885b01abcc08d1672efa880daec (patch)
tree1c4498ae931238d63af4a3309e93b9fabc0d9b1f /models/migrations/v1_22/v296.go
parent90b509aafb5c0696cb1b459e9035ab3fc859f26a (diff)
downloadgitea-main.tar.gz
gitea-main.zip
Rework create/fork/adopt/generate repository to make sure resources will be cleanup once failed (#31035)HEADmain
Fix #28144 To make the resources will be cleanup once failed. All repository operations now follow a consistent pattern: - 1. Create a database record for the repository with the status being_migrated. - 2. Register a deferred cleanup function to delete the repository and its related data if the operation fails. - 3. Perform the actual Git and database operations step by step. - 4. Upon successful completion, update the repository’s status to ready. The adopt operation is a special case — if it fails, the repository on disk should not be deleted.
Diffstat (limited to 'models/migrations/v1_22/v296.go')
0 files changed, 0 insertions, 0 deletions