Dont await to write cache in disk to respond to client#551
Draft
Dont await to write cache in disk to respond to client#551
Conversation
4 tasks
mairatma
reviewed
Oct 24, 2023
|
|
||
| const expiration = Date.now() + (maxAge - currentAge) * 1000 | ||
| await storage.set(setKey, { | ||
| storage.set(setKey, { |
Contributor
There was a problem hiding this comment.
I know this is still in Draft state, but just a suggestion: I feel like the span?.log call on line 210 below should only happen after the write finishes, so that we only log this on success and so that the trace shows the right timestamp for this event.
To do this we'll need to make sure that adding an event to a span after it's closed will work though. It might not be possible. Maybe this event won't make sense within that span anymore actually, since it's an event that happens afterwards, not tied to this span anymore. It'll just be background work now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is the purpose of this pull request?
What problem is this solving?
How should this be manually tested?
Screenshots or example usage
Types of changes