chore: add explanation

This commit is contained in:
Bartosz Sypytkowski 2024-12-10 10:12:33 +01:00
parent 9971c23749
commit c4514ca5bf
1 changed files with 6 additions and 0 deletions

View File

@ -269,6 +269,12 @@ impl CollabCache {
self.disk_cache.batch_insert_collab(records).await?;
// We'll update cache in the background. The reason is that Redis
// doesn't have a good way to do batch insert, so we'll do it one
// by one which may take time if there are many records.
//
// Most of the code doesn't rely on the cache being the only source
// of truth and accepts possibility that its update may fail.
let mem_cache = self.mem_cache.clone();
tokio::spawn(async move {
let now = chrono::Utc::now().timestamp();