Set LogLevel as string and do not wait for bridge when destroying because it is a sync call

This commit is contained in:
Arnaud 2025-10-24 15:13:08 +02:00
parent 35c06ba719
commit 0c19d39d8c
No known key found for this signature in database
GPG Key ID: 20E40A5D3110766F

View File

@ -92,7 +92,7 @@ const (
type Config struct {
// Default: INFO
LogLevel LogLevel `json:"log-level,omitempty"`
LogLevel string `json:"log-level,omitempty"`
// Specifies what kind of logs should be written to stdout
// Default: auto
@ -280,8 +280,12 @@ func (node CodexNode) Destroy() error {
return bridge.callError("cGoCodexDestroy")
}
_, err = bridge.wait()
return err
// We don't wait for the bridge here.
// The destroy function does not call the worker thread,
// it destroys the context directly and return the return
// value synchronously.
return nil
}
// Version returns the version of the Codex node.