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:
Michael McAllister 2022-06-20 16:39:42 +10:00 committed by GitHub
parent 0ab9716aac
commit 015e11bc85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -203,14 +203,14 @@ func New(ctx context.Context, params backend.Params) (*Backend, error) {
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.")
if err := cfg.CheckAndSetDefaults(); err != nil {
return nil, trace.Wrap(err)
}
l.Infof("Initializing backend. Table: %q, poll streams every %v.", cfg.TableName, cfg.PollStreamPeriod)
buf := backend.NewCircularBuffer(
backend.BufferCapacity(cfg.BufferSize),
)