mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +00:00
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
This commit is contained in:
parent
8f8c250ddb
commit
60c5339042
21 changed files with 536 additions and 198 deletions
|
@ -16,7 +16,6 @@ import (
|
|||
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/process"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
|
||||
"github.com/gobwas/glob"
|
||||
|
@ -168,14 +167,11 @@ func generateRepoCommit(e Engine, repo, templateRepo, generateRepo *Repository,
|
|||
}
|
||||
|
||||
repoPath := repo.repoPath(e)
|
||||
_, stderr, err := process.GetManager().ExecDirEnv(
|
||||
-1, tmpDir,
|
||||
fmt.Sprintf("generateRepoCommit(git remote add): %s", repoPath),
|
||||
env,
|
||||
git.GitExecutable, "remote", "add", "origin", repoPath,
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("git remote add: %v - %s", err, stderr)
|
||||
if stdout, err := git.NewCommand("remote", "add", "origin", repoPath).
|
||||
SetDescription(fmt.Sprintf("generateRepoCommit (git remote add): %s to %s", templateRepoPath, tmpDir)).
|
||||
RunInDirWithEnv(tmpDir, env); err != nil {
|
||||
log.Error("Unable to add %v as remote origin to temporary repo to %s: stdout %s\nError: %v", repo, tmpDir, stdout, err)
|
||||
return fmt.Errorf("git remote add: %v", err)
|
||||
}
|
||||
|
||||
return initRepoCommit(tmpDir, repo.Owner)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue