Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This would lead to a very small time save, depending on the database speed, just a few miliseconds each message.
Writing to the MessageLog table causes an insert which for me takes on average about 0.16ms. We would save this 0.16ms several times when starting a session if we just launch a task to do it and disregard the answer.
_ = WriteMessageLog
means we will fire and forget the task.If we get an exception in this task it gets logged anyway, nothing changes there.
Some optimisation where you just need to check if a transaction exists, not actually need to fetch it.
Chose not to add await ... async for all the database calls, becaues this only speeds it up when you have a significant server load. For this project it would indeed be usefull to do it but chose not to do it in this pull request. However now that more function are async it's easier to do it in a later pull request.
Note I did not test any of this yet. Just make sure it compiles. Will test in the coming weeks.