1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-11-06 08:39:09 +02:00

Fixed graceful process termination (#240)

This commit is contained in:
Tim Voronov
2019-02-26 15:32:50 -05:00
committed by GitHub
parent 63dfcdeefd
commit b702f127ed
4 changed files with 26 additions and 39 deletions

View File

@@ -2,11 +2,12 @@ package runtime
import (
"context"
"runtime"
"github.com/MontFerret/ferret/pkg/runtime/core"
"github.com/MontFerret/ferret/pkg/runtime/logging"
"github.com/MontFerret/ferret/pkg/runtime/values"
"github.com/pkg/errors"
"runtime"
)
type Program struct {
@@ -61,12 +62,13 @@ func (p *Program) Run(ctx context.Context, setters ...Option) (result []byte, er
}()
scope, closeFn := core.NewRootScope()
defer func() {
if err := closeFn(); err != nil {
logger.Error().
Timestamp().
Err(err).
Msg("Closing root scope")
Msg("closing root scope")
}
}()