remove init and use Exec

This commit is contained in:
Alfred Kamanda 2024-09-20 13:13:20 +03:00
parent b66891a646
commit e6e701a609
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703
2 changed files with 2 additions and 14 deletions

View File

@ -96,7 +96,7 @@ func main() {
en = en.WithDebug(nil)
}
_, err = en.Init(ctx)
_, err = en.Exec(ctx, []byte{})
if err != nil {
fmt.Fprintf(os.Stderr, "engine init exited with error: %v\n", err)
os.Exit(1)

View File

@ -71,19 +71,7 @@ func(f *BaseSessionHandler) Process(rqs RequestSession) (RequestSession, error)
}
rqs.Engine = en
r, err = rqs.Engine.Init(rqs.Ctx)
if err != nil {
perr := f.provider.Put(rqs.Config.SessionId, rqs.Storage)
rqs.Storage = nil
if perr != nil {
logg.ErrorCtxf(rqs.Ctx, "", "storage put error", perr)
}
return rqs, err
}
if r && len(rqs.Input) > 0 {
r, err = rqs.Engine.Exec(rqs.Ctx, rqs.Input)
}
r, err = rqs.Engine.Exec(rqs.Ctx, rqs.Input)
if err != nil {
perr := f.provider.Put(rqs.Config.SessionId, rqs.Storage)
rqs.Storage = nil