Restart template server if it shuts down (#9200)

This commit is contained in:
ncabatoff 2020-06-15 15:25:45 -04:00 committed by GitHub
parent d8884e44b3
commit bf90d67fef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,7 +153,13 @@ func (ts *Server) Run(ctx context.Context, incoming chan string, templates []*ct
}
case err := <-ts.runner.ErrCh:
ts.logger.Error("template server error", "error", err.Error())
return
ts.runner.StopImmediately()
ts.runner, err = manager.NewRunner(runnerConfig, false)
if err != nil {
ts.logger.Error("template server failed to create", "error", err)
return
}
go ts.runner.Start()
case <-ts.runner.TemplateRenderedCh():
// A template has been rendered, figure out what to do
events := ts.runner.RenderEvents()