reset the state when input is nil

This commit is contained in:
Alfred Kamanda 2024-12-17 17:58:08 +03:00
parent 5428626c3f
commit 5534706189
Signed by untrusted user: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -124,6 +124,16 @@ func (h *Handlers) Init(ctx context.Context, sym string, input []byte) (resource
h.st = h.pe.GetState()
h.ca = h.pe.GetMemory()
fmt.Println("Pre restart state:", h.st)
if len(input) == 0 {
h.st.Restart()
h.st = h.pe.GetState()
}
fmt.Println("New state:", h.st)
sessionId, _ := ctx.Value("SessionId").(string)
flag_admin_privilege, _ := h.flagManager.GetFlag("flag_admin_privilege")