[datastore] Normalize datastore initialization across the codebase with a generic dial function#1409
Conversation
| connectParameters := flags.ConnectParameters() | ||
| connectParameters.DBName = "aux" | ||
| datastore, err := datastore.Dial(ctx, connectParameters) | ||
| auxStore, err := auxc.Dial(ctx, logger, true) |
There was a problem hiding this comment.
The withCronCheck should be false here
There was a problem hiding this comment.
Are you sure? I would normalize scd/rid/aux there, no? Why aux wouldn't be checked like the others?
There was a problem hiding this comment.
I was talking about behavior change.
About normalizing yes makes sense but in a separate PR then? If this behavior change causes any type of issue or interrogation, a commit message with 'generic dial function' won't help identifying the change, even more so when obfuscated by a refactor like here.
There was a problem hiding this comment.
Ok, but the whole PR is about normalizing initializations, that not the only behavior change and this one is really minor, do you really see the need of moving it to a separate PR?
There was a problem hiding this comment.
that not the only behavior change
Which ones did I miss?
this one is really minor
I disagree, it is a pretty visible one, one more DB is going to have pings every minutes. That deserves to be mentioned in the changelog IMO, thus should be included in the git commit message. If it is too much overhead to open a separate PR, a mention of the change in the title of this PR could also work.
There was a problem hiding this comment.
After discussions, updated PR title + added remark in changelog.
8111dcd to
cd706cb
Compare
Follow #1408 , extracted from #1403
Move to a generic
dialfunction, normalizingdatastore.Dialcalls, checks of errors and (optional) cron creation.