aboutsummaryrefslogtreecommitdiffstats
path: root/services/release
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-11-30 08:40:22 -0600
committerLauris BH <lauris@nix.lv>2019-11-30 16:40:22 +0200
commit60c5339042a605076482320313e8f9498dd72af9 (patch)
treebef1e4a0fb9565140fbf142f13d3b7e5f334031d /services/release
parent8f8c250ddbe8dfe785340cb45cbae71c4833acf3 (diff)
downloadgitea-60c5339042a605076482320313e8f9498dd72af9.tar.gz
gitea-60c5339042a605076482320313e8f9498dd72af9.zip
Graceful: Cancel Process on monitor pages & HammerTime (#9213)
* Graceful: Create callbacks to with contexts * Graceful: Say when Gitea is completely finished * Graceful: Git and Process within HammerTime Force all git commands to terminate at HammerTime Force all process commands to terminate at HammerTime Move almost all git processes to run as git Commands * Graceful: Always Hammer after Shutdown * ProcessManager: Add cancel functionality * Fix tests * Make sure that process.Manager.Kill() cancels * Make threadsafe access to Processes and remove own unused Kill * Remove cmd from the process manager as it is no longer used * the default context is the correct context * get rid of double till
Diffstat (limited to 'services/release')
-rw-r--r--services/release/release.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/services/release/release.go b/services/release/release.go
index 2f70bbb665..fd0c410e7c 100644
--- a/services/release/release.go
+++ b/services/release/release.go
@@ -13,7 +13,6 @@ import (
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification"
- "code.gitea.io/gitea/modules/process"
"code.gitea.io/gitea/modules/timeutil"
)
@@ -128,11 +127,11 @@ func DeleteReleaseByID(id int64, doer *models.User, delTag bool) error {
}
if delTag {
- _, stderr, err := process.GetManager().ExecDir(-1, repo.RepoPath(),
- fmt.Sprintf("DeleteReleaseByID (git tag -d): %d", rel.ID),
- git.GitExecutable, "tag", "-d", rel.TagName)
- if err != nil && !strings.Contains(stderr, "not found") {
- return fmt.Errorf("git tag -d: %v - %s", err, stderr)
+ if stdout, err := git.NewCommand("tag", "-d", rel.TagName).
+ SetDescription(fmt.Sprintf("DeleteReleaseByID (git tag -d): %d", rel.ID)).
+ RunInDir(repo.RepoPath()); err != nil && !strings.Contains(err.Error(), "not found") {
+ log.Error("DeleteReleaseByID (git tag -d): %d in %v Failed:\nStdout: %s\nError: %v", rel.ID, repo, stdout, err)
+ return fmt.Errorf("git tag -d: %v", err)
}
if err := models.DeleteReleaseByID(id); err != nil {