Open transactions after validating data #318
Labels
good first issue
Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.
hacktoberfest
priority/important-soon
Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
size/S
estimate of the amount of work to address the issue
Expected Behaviour
As validation code do not access the database, it can be executed outside transaction to reduce transaction time.
Current Behaviour
Currently transaction is opened before data is validated, which extends lock time on database, which increases the latency on multiple requests: https://github.com/tinkerbell/tink/blob/master/db/template.go#L17-L30.
Possible Solution
Validate data first, then open transaction.
The text was updated successfully, but these errors were encountered: