mirror of
https://github.com/gravitational/teleport
synced 2024-10-21 17:53:28 +00:00
Log initilization after CheckAndSetDefaults (#13090)
Super minor, but in this case we log that we're initializing the backend _prior_ to cfg.CheckAndSetDefaults which means that if we are indeed using the default the following will be printed: > {"caller":"dynamo/dynamodbbk.go:206","component":"dynamodb","level":"info","message":"Initializing backend. Table: \"example-table\", poll streams every 0s.","timestamp":"2022-06-01T23:49:49Z"} Which is misleading as it's not polling the stream every "0s", it's polling every 1s as per backend.DefaultPollStreamPeriod Signed-off-by: Michael McAllister <michael.mcallister@goteleport.com>
This commit is contained in:
parent
0ab9716aac
commit
015e11bc85
|
@ -203,14 +203,14 @@ func New(ctx context.Context, params backend.Params) (*Backend, error) {
|
||||||
return nil, trace.BadParameter("DynamoDB configuration is invalid: %v", err)
|
return nil, trace.BadParameter("DynamoDB configuration is invalid: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
l.Infof("Initializing backend. Table: %q, poll streams every %v.", cfg.TableName, cfg.PollStreamPeriod)
|
|
||||||
|
|
||||||
defer l.Debug("AWS session is created.")
|
defer l.Debug("AWS session is created.")
|
||||||
|
|
||||||
if err := cfg.CheckAndSetDefaults(); err != nil {
|
if err := cfg.CheckAndSetDefaults(); err != nil {
|
||||||
return nil, trace.Wrap(err)
|
return nil, trace.Wrap(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
l.Infof("Initializing backend. Table: %q, poll streams every %v.", cfg.TableName, cfg.PollStreamPeriod)
|
||||||
|
|
||||||
buf := backend.NewCircularBuffer(
|
buf := backend.NewCircularBuffer(
|
||||||
backend.BufferCapacity(cfg.BufferSize),
|
backend.BufferCapacity(cfg.BufferSize),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue