mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 04:17:32 +00:00
input from tim
This commit is contained in:
@@ -23,6 +23,7 @@ type Invoker interface {
|
||||
|
||||
// CommandOpts are passed to each command
|
||||
// they provide common fields used by commands like the database client.
|
||||
// Not thread safe because fields can change state during execution.
|
||||
type CommandOpts struct {
|
||||
DB database.QueryExecutor
|
||||
Invoker Invoker
|
||||
|
@@ -83,6 +83,7 @@ func newTraceInvoker(next Invoker) *traceInvoker {
|
||||
}
|
||||
|
||||
// Invoke implements the [Invoker] interface.
|
||||
// TODO(adlerhurst): properly handle call stack, currently you would always get the line of the invoker instead of the code
|
||||
func (i *traceInvoker) Invoke(ctx context.Context, command Commander, opts *CommandOpts) (err error) {
|
||||
ctx, span := tracer.Start(ctx, fmt.Sprintf("%T", command))
|
||||
defer func() {
|
||||
@@ -109,6 +110,7 @@ func newLoggingInvoker(next Invoker) *loggingInvoker {
|
||||
}
|
||||
|
||||
// Invoke implements the [Invoker] interface.
|
||||
// TODO(adlerhurst): properly handle call stack, currently you would always get the line of the invoker instead of the code
|
||||
func (i *loggingInvoker) Invoke(ctx context.Context, command Commander, opts *CommandOpts) (err error) {
|
||||
logger.InfoContext(ctx, "Invoking command", "command", command.String())
|
||||
|
||||
|
Reference in New Issue
Block a user