Call the engine Reset

This commit is contained in:
Alfred Kamanda 2025-02-05 19:16:25 +03:00
parent 68597ea7cc
commit f88e253486
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -2,6 +2,7 @@ package engine
import (
"context"
"fmt"
"git.defalsify.org/vise.git/engine"
"git.defalsify.org/vise.git/resource"
@ -19,7 +20,12 @@ func NewSarafuEngine(cfg engine.Config, rs resource.Resource) *SarafuEngine {
func (se *SarafuEngine) Exec(ctx context.Context, input []byte) (bool, error) {
if len(input) == 0 {
panic("insert something here")
e, ok := se.Engine.(*engine.DefaultEngine)
if !ok {
return false, fmt.Errorf("")
}
e.Reset(ctx, true)
}
return se.Engine.Exec(ctx, input)
}