Add random delay after returning results from the database

Antonio Scandurra created

Change summary

crates/collab/src/db.rs | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Detailed changes

crates/collab/src/db.rs 🔗

@@ -1848,7 +1848,13 @@ where
                 background.simulate_random_delay().await;
             }
 
-            self.runtime.as_ref().unwrap().block_on(body)
+            let result = self.runtime.as_ref().unwrap().block_on(body);
+
+            if let Some(background) = self.background.as_ref() {
+                background.simulate_random_delay().await;
+            }
+
+            result
         }
 
         #[cfg(not(test))]