aboutsummaryrefslogtreecommitdiffstats
path: root/modules/markup/external/external.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/markup/external/external.go')
-rw-r--r--modules/markup/external/external.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/modules/markup/external/external.go b/modules/markup/external/external.go
index 36cbd69f92..3acb601067 100644
--- a/modules/markup/external/external.go
+++ b/modules/markup/external/external.go
@@ -5,7 +5,6 @@
package external
import (
- "context"
"fmt"
"io"
"os"
@@ -107,11 +106,8 @@ func (p *Renderer) Render(ctx *markup.RenderContext, input io.Reader, output io.
ctx.Ctx = graceful.GetManager().ShutdownContext()
}
- processCtx, cancel := context.WithCancel(ctx.Ctx)
- defer cancel()
-
- pid := process.GetManager().Add(fmt.Sprintf("Render [%s] for %s", commands[0], ctx.URLPrefix), cancel)
- defer process.GetManager().Remove(pid)
+ processCtx, _, finished := process.GetManager().AddContext(ctx.Ctx, fmt.Sprintf("Render [%s] for %s", commands[0], ctx.URLPrefix))
+ defer finished()
cmd := exec.CommandContext(processCtx, commands[0], args...)
cmd.Env = append(