Settings: Remove the crawler sleep time setting.

This commit is contained in:
Damir Jelić 2020-01-23 13:32:27 +01:00
parent 4953f32cba
commit 947ea9823d
3 changed files with 2 additions and 22 deletions

View file

@ -46,8 +46,6 @@ export default class ManageEventIndex extends React.Component {
currentRoom: null,
eventIndexingEnabled:
SettingsStore.getValueAt(SettingLevel.DEVICE, 'enableEventIndexing'),
crawlerSleepTime:
SettingsStore.getValueAt(SettingLevel.DEVICE, 'crawlerSleepTime'),
};
}
@ -102,20 +100,6 @@ export default class ManageEventIndex extends React.Component {
});
}
_onEventIndexingEnabledChange = (checked) => {
SettingsStore.setValue("enableCrawling", null, SettingLevel.DEVICE, checked);
if (checked) EventIndexPeg.start();
else EventIndexPeg.stop();
this.setState({eventIndexingEnabled: checked});
}
_onCrawlerSleepTimeChange = (e) => {
this.setState({crawlerSleepTime: e.target.value});
SettingsStore.setValue("crawlerSleepTime", null, SettingLevel.DEVICE, e.target.value);
}
_onDisable = async () => {
this.props.onFinished(false);
}

View file

@ -30,6 +30,7 @@ export default class EventIndex {
// 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;
@ -211,7 +212,7 @@ export default class EventIndex {
// 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 = SettingsStore.getValueAt(SettingLevel.DEVICE, 'crawlerSleepTime');
let sleepTime = this._crawlerSleepTime;
// Don't let the user configure a lower sleep time than 100 ms.
sleepTime = Math.max(sleepTime, 100);

View file

@ -486,11 +486,6 @@ export const SETTINGS = {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: RIGHT_PANEL_PHASES.GroupMemberList,
},
"crawlerSleepTime": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
displayName: _td("How long should the crawler wait between requests"),
default: 3000,
},
"enableEventIndexing": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
displayName: _td("Enable message search in encrypted rooms"),