You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
ManageEventIndexDialog: Add back a control for the crawler sleep time.
This commit is contained in:
@@ -18,6 +18,7 @@ import PlatformPeg from "../PlatformPeg";
|
||||
import {MatrixClientPeg} from "../MatrixClientPeg";
|
||||
import {EventTimeline, RoomMember} from 'matrix-js-sdk';
|
||||
import {sleep} from "../utils/promise";
|
||||
import SettingsStore, {SettingLevel} from "../settings/SettingsStore";
|
||||
import {EventEmitter} from "events";
|
||||
|
||||
/*
|
||||
@@ -30,7 +31,6 @@ export default class EventIndex extends EventEmitter {
|
||||
// The time in ms that the crawler will wait loop iterations if there
|
||||
// have not been any checkpoints to consume in the last iteration.
|
||||
this._crawlerIdleTime = 5000;
|
||||
this._crawlerSleepTime = 3000;
|
||||
// The maximum number of events our crawler should fetch in a single
|
||||
// crawl.
|
||||
this._eventsPerCrawl = 100;
|
||||
@@ -299,10 +299,7 @@ export default class EventIndex extends EventEmitter {
|
||||
let idle = false;
|
||||
|
||||
while (!cancelled) {
|
||||
// This is a low priority task and we don't want to spam our
|
||||
// homeserver with /messages requests so we set a hefty timeout
|
||||
// here.
|
||||
let sleepTime = this._crawlerSleepTime;
|
||||
let sleepTime = SettingsStore.getValueAt(SettingLevel.DEVICE, 'crawlerSleepTime');
|
||||
|
||||
// Don't let the user configure a lower sleep time than 100 ms.
|
||||
sleepTime = Math.max(sleepTime, 100);
|
||||
|
||||
Reference in New Issue
Block a user