Skip to content

Commit

Permalink
Explain why we rewrite cache results (#32447)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 2bef3e8ec40be9406606cf6aa02fed8e8c13cca5
  • Loading branch information
goffrie authored and Convex, Inc. committed Dec 19, 2024
1 parent 3837de6 commit 0425869
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/application/src/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ impl<RT: Runtime> CacheManager<RT> {
None => continue 'top,
};

// Step 4: Rewrite the value into the cache. This method will discard the new
// value if the UDF failed or if a newer (i.e. higher `original_ts`)
// value is in the cache.
// Step 4: Rewrite the value into the cache. If this was a cache hit, this will
// bump the cache result's token. This method will discard the new value if the
// UDF failed or if a newer (i.e. higher `original_ts`) value is in the cache.
if cache_result.outcome.result.is_ok() {
// We do not cache JSErrors
waiting_entry_guard.complete(cache_result.clone());
Expand Down

0 comments on commit 0425869

Please sign in to comment.