mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Second attempt at preventing zombies (#16326)
* Second attempt at preventing zombies * Ensure that the pipes are closed in ssh.go * Ensure that a cancellable context is passed up in cmd/* http requests * Make cmd.fail return properly so defers are obeyed * Ensure that something is sent to stdout in case of blocks here Signed-off-by: Andrew Thornton <art27@cantab.net> * placate lint Signed-off-by: Andrew Thornton <art27@cantab.net> * placate lint 2 Signed-off-by: Andrew Thornton <art27@cantab.net> * placate lint 3 Signed-off-by: Andrew Thornton <art27@cantab.net> * fixup Signed-off-by: Andrew Thornton <art27@cantab.net> * Apply suggestions from code review Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
		@@ -14,6 +14,9 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func runSendMail(c *cli.Context) error {
 | 
			
		||||
	ctx, cancel := installSignals()
 | 
			
		||||
	defer cancel()
 | 
			
		||||
 | 
			
		||||
	setting.NewContext()
 | 
			
		||||
 | 
			
		||||
	if err := argsSet(c, "title"); err != nil {
 | 
			
		||||
@@ -39,7 +42,7 @@ func runSendMail(c *cli.Context) error {
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	status, message := private.SendEmail(subject, body, nil)
 | 
			
		||||
	status, message := private.SendEmail(ctx, subject, body, nil)
 | 
			
		||||
	if status != http.StatusOK {
 | 
			
		||||
		fmt.Printf("error: %s\n", message)
 | 
			
		||||
		return nil
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user