mirror of
https://github.com/hanzoai/agent.git
synced 2026-09-11 21:08:51 +00:00
Consolidate all Hanzo agent infrastructure into one repo: - control-plane/: Go control plane server (was agents-new) - sdk/: Go, Python, TypeScript SDKs - deployments/: Docker, Kubernetes, Helm configs - Dockerfile.sdk: Python SDK image (ghcr.io/hanzoai/agent:latest) - CI builds both SDK + control-plane images No more agentfield — everything is hanzoai/agent.
27 lines
518 B
Go
27 lines
518 B
Go
package storage
|
|
|
|
import (
|
|
"database/sql"
|
|
"errors"
|
|
|
|
"github.com/hanzoai/agents/control-plane/internal/logger"
|
|
)
|
|
|
|
type rollbacker interface {
|
|
Rollback() error
|
|
}
|
|
|
|
// rollbackTx attempts to rollback the transaction and logs a warning when the rollback fails.
|
|
func rollbackTx(tx rollbacker, context string) {
|
|
if tx == nil {
|
|
return
|
|
}
|
|
|
|
if err := tx.Rollback(); err != nil && !errors.Is(err, sql.ErrTxDone) {
|
|
logger.Logger.Warn().
|
|
Err(err).
|
|
Str("context", context).
|
|
Msg("transaction rollback failed")
|
|
}
|
|
}
|