mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
message_fetch: Add small backfill delay.
This should help reduce the risk of hitting rate limits when users have a very large number of messages to fetch via this mechanism. Inline the `messages` variable that was only used in one place while we're touching this.
This commit is contained in:
@@ -222,6 +222,12 @@ function forward_fill_step() {
|
||||
let fetch;
|
||||
|
||||
self.prep = () => {
|
||||
/* Don't wait for the timeout before recursively calling `load_messages`. */
|
||||
const expected_delay = 150;
|
||||
set_global("setTimeout", (f, delay) => {
|
||||
assert.equal(delay, expected_delay);
|
||||
f();
|
||||
});
|
||||
fetch = config_fake_channel({
|
||||
expected_opts_data: initialize_data.forward_fill.req,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user